mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-28 18:40:34 +00:00
Browser fixes
This commit is contained in:
parent
dc93536be9
commit
f15391a1a7
2 changed files with 18 additions and 11 deletions
|
@ -147,16 +147,17 @@ public final class BrowserFileListComp extends SimpleComp {
|
|||
}
|
||||
var inCooldown = Duration.between(lastFail.get(), Instant.now()).toMillis() < 1000;
|
||||
if (inCooldown) {
|
||||
lastFail.set(Instant.now());
|
||||
event.consume();
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
lastFail.set(null);
|
||||
typedSelection.set("");
|
||||
table.getSelectionModel().clearSelection();
|
||||
event.consume();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
lastFail.set(null);
|
||||
typedSelection.set(updated);
|
||||
|
@ -165,9 +166,15 @@ public final class BrowserFileListComp extends SimpleComp {
|
|||
event.consume();
|
||||
});
|
||||
|
||||
table.addEventFilter(MouseEvent.MOUSE_PRESSED, event -> {
|
||||
typedSelection.set("");
|
||||
lastFail.set(null);
|
||||
});
|
||||
|
||||
table.addEventFilter(KeyEvent.KEY_PRESSED,event -> {
|
||||
if (event.getCode() == KeyCode.ESCAPE) {
|
||||
typedSelection.set("");
|
||||
lastFail.set(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -43,12 +43,12 @@ public class BrowserFileListCompEntry {
|
|||
}
|
||||
|
||||
public void onMouseClick(MouseEvent t) {
|
||||
if (showContextMenu(t)) {
|
||||
if (lastContextMenu != null) {
|
||||
lastContextMenu.hide();
|
||||
lastContextMenu = null;
|
||||
}
|
||||
|
||||
if (showContextMenu(t)) {
|
||||
var cm = new BrowserContextMenu(model.getFileSystemModel(), item, false);
|
||||
cm.show(row, t.getScreenX(), t.getScreenY());
|
||||
lastContextMenu = cm;
|
||||
|
|
Loading…
Reference in a new issue