make menu buttons in vault list appear clickable

This commit is contained in:
Armin Schrenk
2025-02-10 18:27:06 +01:00
parent 6b43881909
commit a810eff797
4 changed files with 51 additions and 15 deletions

View File

@@ -26,6 +26,7 @@ import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.geometry.Side;
import javafx.scene.control.Button;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.ListView;
import javafx.scene.input.ContextMenuEvent;
@@ -76,7 +77,7 @@ public class VaultListController implements FxController {
public ListView<Vault> vaultList;
public StackPane root;
@FXML
private HBox addVaultButton;
private Button addVaultButton;
@FXML
private ContextMenu addVaultContextMenu;

View File

@@ -183,19 +183,37 @@
}
.main-window .button-bar {
-fx-min-height:44px;
-fx-max-height:44px;
-fx-background-color: MAIN_BG;
-fx-border-color: CONTROL_BORDER_NORMAL transparent transparent transparent;
-fx-border-width: 1px 0 0 0;
}
.main-window .button-left {
.main-window .button-bar .button-left {
-fx-border-color: CONTROL_BORDER_NORMAL;
-fx-border-width: 0 1px 0 0;
-fx-background-color: MAIN_BG;
-fx-background-radius: 0px;
-fx-min-height: 44px;
-fx-max-height: 44px;
}
.main-window .button-right {
.main-window .button-bar .button-right {
-fx-border-color: CONTROL_BORDER_NORMAL;
-fx-border-width: 0 0 0 1px;
-fx-background-color: MAIN_BG;
-fx-background-radius: 0px;
-fx-min-height: 44px;
-fx-max-height: 44px;
}
.main-window .button-bar .button-left:armed {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
}
.main-window .button-bar .button-right:armed {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
}
/*******************************************************************************

View File

@@ -182,6 +182,8 @@
}
.main-window .button-bar {
-fx-min-height:44px;
-fx-max-height:44px;
-fx-background-color: MAIN_BG;
-fx-border-color: CONTROL_BORDER_NORMAL transparent transparent transparent;
-fx-border-width: 1px 0 0 0;
@@ -190,11 +192,27 @@
.main-window .button-bar .button-left {
-fx-border-color: CONTROL_BORDER_NORMAL;
-fx-border-width: 0 1px 0 0;
-fx-background-color: MAIN_BG;
-fx-background-radius: 0px;
-fx-min-height: 44px;
-fx-max-height: 44px;
}
.main-window .button-bar .button-right {
-fx-border-color: CONTROL_BORDER_NORMAL;
-fx-border-width: 0 0 0 1px;
-fx-background-color: MAIN_BG;
-fx-background-radius: 0px;
-fx-min-height: 44px;
-fx-max-height: 44px;
}
.main-window .button-bar .button-left:armed {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
}
.main-window .button-bar .button-right:armed {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
}
/*******************************************************************************

View File

@@ -11,6 +11,7 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.shape.Arc?>
<?import javafx.scene.control.Button?>
<StackPane xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"
fx:id="root"
@@ -35,19 +36,17 @@
</VBox>
</StackPane>
<HBox styleClass="button-bar">
<HBox fx:id="addVaultButton" onMouseClicked="#toggleMenu" styleClass="button-left" alignment="CENTER" minWidth="20">
<padding>
<Insets topRightBottomLeft="12"/>
</padding>
<FontAwesome5IconView glyph="PLUS" HBox.hgrow="NEVER" glyphSize="16"/>
</HBox>
<Button fx:id="addVaultButton" onMouseClicked="#toggleMenu" styleClass="button-left" alignment="CENTER" minWidth="20" contentDisplay="GRAPHIC_ONLY">
<graphic>
<FontAwesome5IconView glyph="PLUS" glyphSize="16"/>
</graphic>
</Button>
<Region HBox.hgrow="ALWAYS"/>
<HBox onMouseClicked="#showPreferences" styleClass="button-right" alignment="CENTER" minWidth="20">
<padding>
<Insets topRightBottomLeft="12"/>
</padding>
<FontAwesome5IconView glyph="COG" HBox.hgrow="NEVER" glyphSize="16"/>
</HBox>
<Button onMouseClicked="#showPreferences" styleClass="button-right" alignment="CENTER" minWidth="20" contentDisplay="GRAPHIC_ONLY">
<graphic>
<FontAwesome5IconView glyph="COG" glyphSize="16"/>
</graphic>
</Button>
</HBox>
</VBox>
<Region styleClass="drag-n-drop-border" visible="${controller.draggingVaultOver}"/>