mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Small browser fixes
This commit is contained in:
parent
dcb43a43ab
commit
c2e5e0fa0d
4 changed files with 11 additions and 1 deletions
|
@ -190,6 +190,7 @@ final class BrowserFileListComp extends SimpleComp {
|
|||
browserAction.execute(fileList.getFileSystemModel(), selected);
|
||||
});
|
||||
});
|
||||
event.consume();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import lombok.Getter;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
|
@ -97,6 +98,10 @@ public class BrowserFileListCompEntry {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!Objects.equals(model.getFileSystemModel().getFileSystem(), cb.getEntries().get(0).getFileSystem())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Prevent drag and drops of files into the current directory
|
||||
if (cb.getBaseDirectory() != null && cb
|
||||
.getBaseDirectory()
|
||||
|
|
|
@ -20,6 +20,11 @@ public interface LeafAction extends BrowserAction {
|
|||
default Button toButton(OpenFileSystemModel model, List<BrowserEntry> selected) {
|
||||
var b = new Button();
|
||||
b.setOnAction(event -> {
|
||||
// Only accept shortcut actions in the current tab
|
||||
if (!model.equals(model.getBrowserModel().getSelected().getValue())) {
|
||||
return;
|
||||
}
|
||||
|
||||
ThreadHelper.runFailableAsync(() -> {
|
||||
BooleanScope.execute(model.getBusy(), () -> {
|
||||
execute(model, selected);
|
||||
|
|
|
@ -24,7 +24,6 @@ public class Shortcuts {
|
|||
public static <T extends Region> void addShortcut(T region, KeyCombination comb, Consumer<T> exec) {
|
||||
var filter = new EventHandler<KeyEvent>() {
|
||||
public void handle(KeyEvent ke) {
|
||||
var target = ke.getTarget();
|
||||
if (!region.isVisible() || !region.isManaged() || region.isDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue