From 9e67740161808993b33f8f112921f3ce7723893a Mon Sep 17 00:00:00 2001 From: Peter <pt033@hdm-stuttgart.de> Date: Mon, 18 Dec 2023 00:35:59 +0100 Subject: [PATCH] update(ui): add pressed visualisation to skin selection scene #14 --- src/main/resources/fxml/SkinSelection.fxml | 6 +++--- src/main/resources/styles/style.css | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/resources/fxml/SkinSelection.fxml b/src/main/resources/fxml/SkinSelection.fxml index 337f901b..9e6db7b5 100644 --- a/src/main/resources/fxml/SkinSelection.fxml +++ b/src/main/resources/fxml/SkinSelection.fxml @@ -12,7 +12,7 @@ <children> <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="40.0"> <children> - <ToggleButton contentDisplay="TOP" mnemonicParsing="false" text="Elias"> + <ToggleButton contentDisplay="TOP" mnemonicParsing="false" styleClass="skinSelection" text="Elias"> <graphic> <ImageView fx:id="selection1" fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> <image> @@ -24,7 +24,7 @@ <ToggleGroup fx:id="selectionButton" /> </toggleGroup> </ToggleButton> - <ToggleButton contentDisplay="TOP" mnemonicParsing="false" text="Erzan" toggleGroup="$selectionButton"> + <ToggleButton contentDisplay="TOP" mnemonicParsing="false" styleClass="skinSelection" text="Erzan" toggleGroup="$selectionButton"> <graphic> <ImageView fx:id="selection2" fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> <image> @@ -33,7 +33,7 @@ </ImageView> </graphic> </ToggleButton> - <ToggleButton contentDisplay="TOP" mnemonicParsing="false" text="Martin" toggleGroup="$selectionButton"> + <ToggleButton contentDisplay="TOP" mnemonicParsing="false" styleClass="skinSelection" text="Martin" toggleGroup="$selectionButton"> <graphic> <ImageView fx:id="selection3" fitHeight="700.0" fitWidth="700.0" pickOnBounds="true" preserveRatio="true"> <image> diff --git a/src/main/resources/styles/style.css b/src/main/resources/styles/style.css index 21f32160..f135e70d 100644 --- a/src/main/resources/styles/style.css +++ b/src/main/resources/styles/style.css @@ -81,3 +81,7 @@ -fx-skin: "de.hdm_stuttgart.battlearena.Controller.ToggleButtonTransition"; -fx-background-color: none; } + +.skinSelection:pressed { + -fx-background-color: rgba(255, 255, 255, 0.3); +} \ No newline at end of file -- GitLab