@@ -36,6 +36,7 @@ import javafx.geometry.Pos;
|
|||||||
import javafx.geometry.Rectangle2D;
|
import javafx.geometry.Rectangle2D;
|
||||||
import javafx.scene.Cursor;
|
import javafx.scene.Cursor;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.ScrollPane;
|
import javafx.scene.control.ScrollPane;
|
||||||
@@ -1387,6 +1388,16 @@ public final class FXUtils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void clearFocus(Node node) {
|
||||||
|
Scene scene = node.getScene();
|
||||||
|
if (scene != null) {
|
||||||
|
Parent root = scene.getRoot();
|
||||||
|
if (root != null) {
|
||||||
|
root.requestFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void copyOnDoubleClick(Labeled label) {
|
public static void copyOnDoubleClick(Labeled label) {
|
||||||
label.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
|
label.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
|
||||||
if (e.getButton() == MouseButton.PRIMARY && e.getClickCount() == 2) {
|
if (e.getButton() == MouseButton.PRIMARY && e.getClickCount() == 2) {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public abstract class ToolbarListPageSkin<T extends ListPageBase<? extends Node>
|
|||||||
ret.setText(text);
|
ret.setText(text);
|
||||||
ret.setOnAction(e -> {
|
ret.setOnAction(e -> {
|
||||||
onClick.run();
|
onClick.run();
|
||||||
ret.getScene().getRoot().requestFocus();
|
FXUtils.clearFocus(ret);
|
||||||
});
|
});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public final class VersionsPage extends Control implements WizardPage, Refreshab
|
|||||||
JFXButton wikiButton = newToggleButton4(SVG.GLOBE_BOOK);
|
JFXButton wikiButton = newToggleButton4(SVG.GLOBE_BOOK);
|
||||||
wikiButton.setOnAction(event -> {
|
wikiButton.setOnAction(event -> {
|
||||||
onOpenWiki();
|
onOpenWiki();
|
||||||
wikiButton.getScene().getRoot().requestFocus();
|
FXUtils.clearFocus(wikiButton);
|
||||||
});
|
});
|
||||||
FXUtils.installFastTooltip(wikiButton, i18n("wiki.tooltip"));
|
FXUtils.installFastTooltip(wikiButton, i18n("wiki.tooltip"));
|
||||||
actions.getChildren().add(wikiButton);
|
actions.getChildren().add(wikiButton);
|
||||||
|
|||||||
Reference in New Issue
Block a user