From 7c397237c40b9e540bccc220e526baa70c279102 Mon Sep 17 00:00:00 2001 From: Dirk Lemmermann Date: Mon, 2 Sep 2024 18:30:43 +0200 Subject: [PATCH] Various changes here and there :-) --- .../mobile/components/CategorySelectionView.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/CategorySelectionView.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/CategorySelectionView.java index 6892b916..69e1a42c 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/CategorySelectionView.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/CategorySelectionView.java @@ -28,6 +28,7 @@ import javafx.scene.control.Label; import javafx.scene.control.ToggleGroup; import javafx.scene.image.ImageView; +import javafx.scene.input.MouseButton; import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; @@ -174,9 +175,11 @@ private CustomToggleButton createButton(String text, Ikon icon, String path) { button.setGraphic(new FontIcon(icon)); button.setMaxWidth(Double.MAX_VALUE); button.setUserData(path); - button.setOnMousePressed(evt -> { - MobileHomePage.getInstance().setContentType(MobileHomePage.ContentType.NORMAL); - MobileLinkUtil.getToPage(path); + button.setOnMouseClicked(evt -> { + if (evt.getButton().equals(MouseButton.PRIMARY) && evt.isStillSincePress()) { + MobileHomePage.getInstance().setContentType(MobileHomePage.ContentType.NORMAL); + MobileLinkUtil.getToPage(path); + } }); toggleGroup.getToggles().add(button); return button;