Small browser fixes

This commit is contained in:
crschnick 2023-12-04 16:40:30 +00:00
parent dcb43a43ab
commit c2e5e0fa0d
4 changed files with 11 additions and 1 deletions

View file

@ -190,6 +190,7 @@ final class BrowserFileListComp extends SimpleComp {
browserAction.execute(fileList.getFileSystemModel(), selected);
});
});
event.consume();
});
}

View file

@ -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()

View file

@ -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);

View file

@ -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;
}