fixes drag drop

pull/5370/head
bunsenstraat 11 months ago
parent c8be118ac5
commit 0eef4835a2
  1. 2
      apps/remixdesktop/src/menus/file.ts
  2. 5
      apps/remixdesktop/src/menus/view.ts
  3. 2
      apps/remixdesktop/src/plugins/fsPlugin.ts
  4. 4
      libs/remix-ui/workspace/src/lib/components/flat-tree.tsx

@ -35,7 +35,7 @@ export default (
} }
}, },
{ {
label: 'Open Folder', label: 'Open Folder in New Window',
accelerator: commandKeys['folder:open'], accelerator: commandKeys['folder:open'],
click(item, focusedWindow) { click(item, focusedWindow) {
execCommand('folder:open', focusedWindow); execCommand('folder:open', focusedWindow);

@ -63,9 +63,12 @@ export default (
click: function(item, focusedWindow) { click: function(item, focusedWindow) {
if (focusedWindow){ if (focusedWindow){
let factor = focusedWindow.webContents.getZoomFactor() let factor = focusedWindow.webContents.getZoomFactor()
console.log(factor)
if (factor > 1.25) { if (factor > 1.25) {
factor = factor - 1.25 factor = factor - 0.25
focusedWindow.webContents.setZoomFactor(factor) focusedWindow.webContents.setZoomFactor(factor)
}else{
focusedWindow.webContents.setZoomFactor(1)
} }
} }

@ -368,6 +368,7 @@ class FSPluginClient extends ElectronBasePluginClient {
if (!path) { if (!path) {
dirs = dialog.showOpenDialogSync(this.window, { dirs = dialog.showOpenDialogSync(this.window, {
properties: ['openDirectory', 'createDirectory', 'showHiddenFiles'], properties: ['openDirectory', 'createDirectory', 'showHiddenFiles'],
title: 'Open folder',
}) })
} }
path = dirs && dirs.length && dirs[0] ? dirs[0] : path path = dirs && dirs.length && dirs[0] ? dirs[0] : path
@ -383,6 +384,7 @@ class FSPluginClient extends ElectronBasePluginClient {
if (!path) { if (!path) {
dirs = dialog.showOpenDialogSync(this.window, { dirs = dialog.showOpenDialogSync(this.window, {
properties: ['openDirectory', 'createDirectory', 'showHiddenFiles'], properties: ['openDirectory', 'createDirectory', 'showHiddenFiles'],
title: 'Open folder',
}) })
} }
path = dirs && dirs.length && dirs[0] ? dirs[0] : path path = dirs && dirs.length && dirs[0] ? dirs[0] : path

@ -108,7 +108,7 @@ export const FlatTree = (props: FlatTreeProps) => {
const onDragStart = async (event: SyntheticEvent) => { const onDragStart = async (event: SyntheticEvent) => {
const target = await getEventTarget(event) const target = await getEventTarget(event)
setDragSource(flatTree[target.path]) setDragSource(flatTree.find((item) => item.path === target.path))
setIsDragging(true) setIsDragging(true)
} }
@ -126,7 +126,7 @@ export const FlatTree = (props: FlatTreeProps) => {
} }
const getFlatTreeItem = (path: string) => { const getFlatTreeItem = (path: string) => {
return flatTree[path] return flatTree.find((item) => item.path === path)
} }
const getFileStateClasses = (file: FileType) => { const getFileStateClasses = (file: FileType) => {

Loading…
Cancel
Save