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;
|
var inCooldown = Duration.between(lastFail.get(), Instant.now()).toMillis() < 1000;
|
||||||
if (inCooldown) {
|
if (inCooldown) {
|
||||||
|
lastFail.set(Instant.now());
|
||||||
event.consume();
|
event.consume();
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
lastFail.set(null);
|
lastFail.set(null);
|
||||||
typedSelection.set("");
|
typedSelection.set("");
|
||||||
table.getSelectionModel().clearSelection();
|
table.getSelectionModel().clearSelection();
|
||||||
event.consume();
|
event.consume();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lastFail.set(null);
|
lastFail.set(null);
|
||||||
typedSelection.set(updated);
|
typedSelection.set(updated);
|
||||||
|
@ -165,9 +166,15 @@ public final class BrowserFileListComp extends SimpleComp {
|
||||||
event.consume();
|
event.consume();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
table.addEventFilter(MouseEvent.MOUSE_PRESSED, event -> {
|
||||||
|
typedSelection.set("");
|
||||||
|
lastFail.set(null);
|
||||||
|
});
|
||||||
|
|
||||||
table.addEventFilter(KeyEvent.KEY_PRESSED,event -> {
|
table.addEventFilter(KeyEvent.KEY_PRESSED,event -> {
|
||||||
if (event.getCode() == KeyCode.ESCAPE) {
|
if (event.getCode() == KeyCode.ESCAPE) {
|
||||||
typedSelection.set("");
|
typedSelection.set("");
|
||||||
|
lastFail.set(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,12 +43,12 @@ public class BrowserFileListCompEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onMouseClick(MouseEvent t) {
|
public void onMouseClick(MouseEvent t) {
|
||||||
if (showContextMenu(t)) {
|
|
||||||
if (lastContextMenu != null) {
|
if (lastContextMenu != null) {
|
||||||
lastContextMenu.hide();
|
lastContextMenu.hide();
|
||||||
lastContextMenu = null;
|
lastContextMenu = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (showContextMenu(t)) {
|
||||||
var cm = new BrowserContextMenu(model.getFileSystemModel(), item, false);
|
var cm = new BrowserContextMenu(model.getFileSystemModel(), item, false);
|
||||||
cm.show(row, t.getScreenX(), t.getScreenY());
|
cm.show(row, t.getScreenX(), t.getScreenY());
|
||||||
lastContextMenu = cm;
|
lastContextMenu = cm;
|
||||||
|
|
Loading…
Reference in a new issue