Small fixes

This commit is contained in:
crschnick
2024-05-11 10:00:36 +00:00
parent fe5686c05f
commit 770a9a0263
7 changed files with 54 additions and 35 deletions
@@ -42,7 +42,9 @@ public class BrowserFileListCompEntry {
// Only clear for normal clicks
if (t.isStillSincePress()) {
model.getSelection().clear();
tv.requestFocus();
if (tv != null) {
tv.requestFocus();
}
}
t.consume();
return;
@@ -65,7 +65,8 @@ public class OpenFileSystemComp extends SimpleComp {
var backBtn = BrowserAction.byId("back", model, List.of()).toButton(root, model, List.of());
var forthBtn = BrowserAction.byId("forward", model, List.of()).toButton(root, model, List.of());
var refreshBtn = BrowserAction.byId("refresh", model, List.of()).toButton(root, model, List.of());
var terminalBtn = BrowserAction.byId("openTerminal", model, List.of()).toButton(root, model, List.of());
// Don't handle key events for this button, we also have that available as a menu item
var terminalBtn = BrowserAction.byId("openTerminal", model, List.of()).toButton(new Region(), model, List.of());
var menuButton = new MenuButton(null, new FontIcon
("mdral-folder_open"));
@@ -1,5 +1,6 @@
package io.xpipe.app.comp.base;
import atlantafx.base.theme.Styles;
import io.xpipe.app.core.AppFont;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.fxcomps.Comp;
@@ -35,6 +36,11 @@ public class ModalOverlayComp extends SimpleComp {
var bgRegion = background.createRegion();
var modal = new ModalPane();
AppFont.small(modal);
modal.focusedProperty().addListener((observable, oldValue, newValue) -> {
if (newValue) {
modal.getContent().requestFocus();
}
});
modal.getStyleClass().add("modal-overlay-comp");
var pane = new StackPane(bgRegion, modal);
pane.setPickOnBounds(false);
@@ -62,12 +68,17 @@ public class ModalOverlayComp extends SimpleComp {
AppFont.normal(l);
var r = newValue.content.createRegion();
var box = new VBox(l, r);
box.focusedProperty().addListener((o, old, n) -> {
if (n) {
r.requestFocus();
}
});
box.setSpacing(10);
box.setPadding(new Insets(10, 15, 15, 15));
if (newValue.finishKey != null) {
var finishButton = new Button(AppI18n.get(newValue.finishKey));
finishButton.setDefaultButton(true);
finishButton.getStyleClass().add(Styles.ACCENT);
finishButton.setOnAction(event -> {
newValue.onFinish.run();
overlayContent.setValue(null);
@@ -88,12 +99,17 @@ public class ModalOverlayComp extends SimpleComp {
modalBox.prefHeightProperty().bind(box.heightProperty());
modalBox.maxWidthProperty().bind(box.widthProperty());
modalBox.maxHeightProperty().bind(box.heightProperty());
modalBox.focusedProperty().addListener((o, old, n) -> {
if (n) {
box.requestFocus();
}
});
modal.show(modalBox);
// Wait 2 pulses before focus so that the scene can be assigned to r
Platform.runLater(() -> {
Platform.runLater(() -> {
r.requestFocus();
modalBox.requestFocus();
});
});
}
@@ -150,7 +150,6 @@ public class AppMainWindow {
// Close other windows
Stage.getWindows().stream().filter(w -> !w.equals(stage)).toList().forEach(w -> w.fireEvent(e));
stage.close();
AppPrefs.get().closeBehaviour().getValue().run();
e.consume();
});
@@ -158,6 +157,7 @@ public class AppMainWindow {
stage.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
if (event.getCode().equals(KeyCode.Q) && event.isShortcutDown()) {
stage.close();
AppPrefs.get().closeBehaviour().getValue().run();
event.consume();
}
});
@@ -21,7 +21,7 @@ public class AppPreloader extends Preloader {
var c = Class.forName(
ModuleLayer.boot().findModule("javafx.graphics").orElseThrow(), "com.sun.glass.ui.Application");
var m = c.getDeclaredMethod("setName", String.class);
m.invoke(c.getMethod("GetApplication").invoke(null), "XPipe");
m.invoke(c.getMethod("GetApplication").invoke(null), AppProperties.get().isStaging() ? "XPipe PTB" : "XPipe");
TrackEvent.info("Application preloader run");
}
}
@@ -1,9 +1,8 @@
/* For development
*:focused {
-fx-border-width: 1;
-fx-border-color: red;
}
*/
.store-layout .split-pane-divider {
-fx-background-color: transparent;
+28 -27
View File
@@ -1,29 +1,3 @@
## Git handling improvements
The git error actions have been reworked. In case any merge conflict or similar occurs, the possible actions are now handled better:
- They are properly highlighted to distinguish them from the normal error dialog window
- They now work for all git client localizations
- They are less likely to cause git accidents. Any possible destructive action has to be confirmed now
## Shortcut handling
The file browser has been reworked to support many new keyboard shortcuts and the general using experience has been improved when using a keyboard:
- Files that are right-clicked are now also included in the selection
- The quick access menu will now shift focus properly
- The file list can be navigated with the arrow keys. CTRL and SHIFT can be used to multiple select files
- Any files you drag can now be explicitly moved by holding ALT
- *CTRL+W* closes the current file browser tab
- *CTRL+SHIFT+W* closes all file browser tabs
- *CTRL+Q* closes the window
- *CTRL+F* will now properly toggle the find text field
- *CTRL+L* will now focus the path location text field
- *ALT+HOME* will go to the file system overview page
- *ALT+H* shows the browsing history
- *ALT-UP* navigates to the parent directory
- *ESCAPE* clears the selection
- *SPACE* shows the context menu for the selection
## Fixes
- Fix custom scripts not properly applying
@@ -35,7 +9,34 @@ The file browser has been reworked to support many new keyboard shortcuts and th
- Fix headless system error message not being printed when application failed to start up
- Fix offline licenses not properly applying
- Fix WMClass not being properly set on Linux
- Fix file browser files being dragged into finder creating raw clipboard file
- Fix file browser files being dragged into macOS finder creating raw clipboard file
- Fix SSH gateway not updating when choosing key file on another host
- Fix file browser failing to connect if target system did not have id command available
- Fix git share file button not jumping to correct settings menu
## Shortcut handling
The file browser has been reworked to support many new keyboard shortcuts and the general using experience has been improved when using a keyboard:
- Files that are right-clicked are now also included in the selection
- The quick access menu will now shift focus properly
- The file list can be navigated with the arrow keys. CTRL and SHIFT can be used to multiple select files
- Any files you drag can now be explicitly moved by holding ALT
- Renaming files will now preserve the selection
- *CTRL+W* closes the current file browser tab
- *CTRL+SHIFT+W* closes all file browser tabs
- *CTRL+Q* closes the window
- *CTRL+F* will now properly toggle the find text field
- *CTRL+L* will now focus the path location text field
- *ALT+HOME* will go to the file system overview page
- *ALT+H* shows the browsing history
- *ALT-UP* navigates to the parent directory
- *ESCAPE* clears the selection
- *SPACE* shows the context menu for the selection
-
## Git handling improvements
The git error actions have been reworked. In case any merge conflict or similar occurs, the possible actions are now handled better:
- They are properly highlighted to distinguish them from the normal error dialog window
- They now work for all git client localizations
- They are less likely to cause git accidents. Any possible destructive action has to be confirmed now