From 8381e088cc9ed70b63aa10c9a2514ee880006fd7 Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Sun, 17 Sep 2017 19:10:01 +0200 Subject: [PATCH] improved filter ui --- .../resources/languages/_de.properties | 2 +- .../resources/languages/_en.properties | 2 +- .../ui/controller/FilterController.java | 19 +- .../budgetmaster/ui/fxml/FilterGUI.fxml | 234 ++++++++++-------- 4 files changed, 153 insertions(+), 104 deletions(-) diff --git a/src/de/deadlocker8/budgetmaster/resources/languages/_de.properties b/src/de/deadlocker8/budgetmaster/resources/languages/_de.properties index a92ec778d..155447b83 100644 --- a/src/de/deadlocker8/budgetmaster/resources/languages/_de.properties +++ b/src/de/deadlocker8/budgetmaster/resources/languages/_de.properties @@ -219,7 +219,7 @@ filter.type=Art filter.type.income=Einnahme filter.type.payment=Ausgabe filter.repeating=Wiederholung -filter.repeating.none=keine Wiederholung +filter.repeating.none=keine filter.repeating.monthday=monatlich filter.repeating.interval=alle X Tage filter.categories=Kategorien diff --git a/src/de/deadlocker8/budgetmaster/resources/languages/_en.properties b/src/de/deadlocker8/budgetmaster/resources/languages/_en.properties index aefaa2180..57af4d2e6 100644 --- a/src/de/deadlocker8/budgetmaster/resources/languages/_en.properties +++ b/src/de/deadlocker8/budgetmaster/resources/languages/_en.properties @@ -219,7 +219,7 @@ filter.type=Type filter.type.income=Income filter.type.payment=Payment filter.repeating=Repeating -filter.repeating.none=no repeating +filter.repeating.none=none filter.repeating.monthday=monthly filter.repeating.interval=every X days filter.categories=Categories diff --git a/src/de/deadlocker8/budgetmaster/ui/controller/FilterController.java b/src/de/deadlocker8/budgetmaster/ui/controller/FilterController.java index 441dab1b4..0404e945e 100644 --- a/src/de/deadlocker8/budgetmaster/ui/controller/FilterController.java +++ b/src/de/deadlocker8/budgetmaster/ui/controller/FilterController.java @@ -16,6 +16,7 @@ import javafx.fxml.FXML; import javafx.scene.Node; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; +import javafx.scene.control.Label; import javafx.scene.control.ScrollPane; import javafx.scene.control.TextField; import javafx.scene.input.KeyCode; @@ -46,6 +47,9 @@ public class FilterController extends BaseController implements Styleable @FXML private Button buttonCategoryNone; @FXML private Button buttonTagsAll; @FXML private Button buttonTagsNone; + @FXML private Label labelSeparator; + @FXML private Label labelSeparatorHorizontalLeft; + @FXML private Label labelSeparatorHorizontalRight; private Stage parentStage; private Controller controller; @@ -114,7 +118,7 @@ public class FilterController extends BaseController implements Styleable } }); - vboxMain.prefWidthProperty().bind(scrollPane.widthProperty().subtract(25)); + vboxMain.prefWidthProperty().bind(scrollPane.widthProperty().subtract(5)); vboxMain.prefHeightProperty().bind(scrollPane.heightProperty().subtract(5)); preselect(); } @@ -254,6 +258,19 @@ public class FilterController extends BaseController implements Styleable buttonFilter.setGraphic(Helpers.getFontIcon(FontIconType.FILTER, 17, Color.WHITE)); scrollPane.setStyle("-fx-background-color: transparent"); + + labelSeparator.setStyle("-fx-background-color: #CCCCCC;"); + labelSeparator.setMinWidth(1); + labelSeparator.setMaxWidth(1); + + labelSeparatorHorizontalLeft.setStyle("-fx-background-color: #CCCCCC;"); + labelSeparatorHorizontalLeft.setMinHeight(1); + labelSeparatorHorizontalLeft.setMaxHeight(1); + + labelSeparatorHorizontalRight.setStyle("-fx-background-color: #CCCCCC;"); + labelSeparatorHorizontalRight.setMinHeight(1); + labelSeparatorHorizontalRight.setMaxHeight(1); + buttonCancel.setStyle("-fx-background-color: " + ConvertTo.toRGBHexWithoutOpacity(Colors.BACKGROUND_BUTTON_BLUE) + "; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;"); buttonReset.setStyle("-fx-background-color: " + ConvertTo.toRGBHexWithoutOpacity(Colors.BACKGROUND_BUTTON_BLUE) + "; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;"); buttonFilter.setStyle("-fx-background-color: " + ConvertTo.toRGBHexWithoutOpacity(Colors.BACKGROUND_BUTTON_BLUE) + "; -fx-text-fill: white; -fx-font-weight: bold; -fx-font-size: 15;"); diff --git a/src/de/deadlocker8/budgetmaster/ui/fxml/FilterGUI.fxml b/src/de/deadlocker8/budgetmaster/ui/fxml/FilterGUI.fxml index 41999d4ad..e7585bb45 100644 --- a/src/de/deadlocker8/budgetmaster/ui/fxml/FilterGUI.fxml +++ b/src/de/deadlocker8/budgetmaster/ui/fxml/FilterGUI.fxml @@ -8,15 +8,14 @@ <?import javafx.scene.control.TextField?> <?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.HBox?> -<?import javafx.scene.layout.Region?> <?import javafx.scene.layout.VBox?> <?import javafx.scene.text.Font?> -<AnchorPane prefHeight="600.0" prefWidth="450.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"> +<AnchorPane prefHeight="600.0" prefWidth="650.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"> <children> <ScrollPane fx:id="scrollPane" hbarPolicy="NEVER" layoutX="14.0" layoutY="14.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0"> <content> - <VBox fx:id="vboxMain" prefHeight="567.0" prefWidth="409.0" spacing="15.0"> + <VBox fx:id="vboxMain" prefHeight="567.0" prefWidth="619.0" spacing="15.0"> <children> <Label text="%filter.headline"> <font> @@ -26,86 +25,148 @@ <Insets bottom="-5.0" /> </VBox.margin> </Label> - <VBox prefHeight="15.0" prefWidth="422.0" spacing="5.0"> + <HBox alignment="TOP_CENTER" VBox.vgrow="ALWAYS"> <children> - <Label text="%filter.type"> - <font> - <Font name="System Bold" size="16.0" /> - </font> - </Label> - <HBox prefHeight="10.0" prefWidth="422.0" spacing="25.0"> - <children> - <CheckBox fx:id="checkBoxIncome" mnemonicParsing="false" text="%filter.type.income"> - <font> - <Font size="14.0" /> - </font> - </CheckBox> - <CheckBox fx:id="checkBoxPayment" mnemonicParsing="false" text="%filter.type.payment"> - <font> - <Font size="14.0" /> - </font> - </CheckBox> - </children> - </HBox> - </children> - </VBox> - <VBox prefHeight="33.0" prefWidth="422.0" spacing="5.0"> - <children> - <Label text="%filter.repeating"> - <font> - <Font name="System Bold" size="16.0" /> - </font> - </Label> - <HBox spacing="10.0"> + <VBox prefHeight="200.0" prefWidth="100.0" spacing="20.0" HBox.hgrow="ALWAYS"> <children> - <CheckBox fx:id="checkBoxNoRepeating" mnemonicParsing="false" text="%filter.repeating.none"> - <font> - <Font size="14.0" /> - </font> - </CheckBox> - <CheckBox fx:id="checkBoxMonthlyRepeating" mnemonicParsing="false" text="%filter.repeating.monthday"> - <font> - <Font size="14.0" /> - </font> - </CheckBox> - <CheckBox fx:id="checkBoxRepeatEveryXDays" mnemonicParsing="false" text="%filter.repeating.interval"> + <VBox prefHeight="15.0" prefWidth="422.0" spacing="5.0"> + <children> + <Label text="%filter.type"> + <font> + <Font name="System Bold" size="16.0" /> + </font> + </Label> + <HBox prefHeight="10.0" prefWidth="422.0" spacing="25.0"> + <children> + <CheckBox fx:id="checkBoxIncome" mnemonicParsing="false" text="%filter.type.income"> + <font> + <Font size="14.0" /> + </font> + </CheckBox> + <CheckBox fx:id="checkBoxPayment" mnemonicParsing="false" text="%filter.type.payment"> + <font> + <Font size="14.0" /> + </font> + </CheckBox> + </children> + </HBox> + </children> + <padding> + <Insets right="10.0" /> + </padding> + </VBox> + <Label fx:id="labelSeparatorHorizontalLeft" maxWidth="1.7976931348623157E308" prefHeight="5.0" prefWidth="287.0"> <font> - <Font size="14.0" /> + <Font size="1.0" /> </font> - </CheckBox> + </Label> + <VBox prefHeight="150.0" prefWidth="422.0" spacing="5.0" VBox.vgrow="ALWAYS"> + <children> + <HBox spacing="10.0"> + <children> + <Label maxWidth="1.7976931348623157E308" text="%filter.categories" HBox.hgrow="ALWAYS"> + <font> + <Font name="System Bold" size="16.0" /> + </font> + </Label> + <Button fx:id="buttonCategoryAll" mnemonicParsing="false" onAction="#enableAllCategories" text="%filter.categories.button.all"> + <font> + <Font name="System Bold" size="13.0" /> + </font> + </Button> + <Button fx:id="buttonCategoryNone" mnemonicParsing="false" onAction="#disableAllCategories" text="%filter.categories.button.none"> + <font> + <Font name="System Bold" size="13.0" /> + </font> + </Button> + </children> + </HBox> + <ScrollPane prefHeight="183.0" prefWidth="297.0" VBox.vgrow="ALWAYS"> + <content> + <VBox fx:id="vboxCategories" spacing="5.0" /> + </content> + </ScrollPane> + </children> + <padding> + <Insets right="10.0" /> + </padding> + </VBox> </children> - </HBox> - </children> - </VBox> - <VBox prefHeight="150.0" prefWidth="422.0" spacing="5.0" VBox.vgrow="ALWAYS"> - <children> - <HBox spacing="10.0"> + </VBox> + <Label fx:id="labelSeparator" maxHeight="1.7976931348623157E308" /> + <VBox prefHeight="200.0" prefWidth="100.0" spacing="20.0" HBox.hgrow="ALWAYS"> <children> - <Label text="%filter.categories"> + <VBox prefHeight="33.0" prefWidth="422.0" spacing="5.0"> + <children> + <Label text="%filter.repeating"> + <font> + <Font name="System Bold" size="16.0" /> + </font> + </Label> + <HBox spacing="10.0"> + <children> + <CheckBox fx:id="checkBoxNoRepeating" mnemonicParsing="false" text="%filter.repeating.none"> + <font> + <Font size="14.0" /> + </font> + </CheckBox> + <CheckBox fx:id="checkBoxMonthlyRepeating" mnemonicParsing="false" text="%filter.repeating.monthday"> + <font> + <Font size="14.0" /> + </font> + </CheckBox> + <CheckBox fx:id="checkBoxRepeatEveryXDays" mnemonicParsing="false" text="%filter.repeating.interval"> + <font> + <Font size="14.0" /> + </font> + </CheckBox> + </children> + </HBox> + </children> + <padding> + <Insets left="10.0" /> + </padding> + </VBox> + <Label fx:id="labelSeparatorHorizontalRight" maxWidth="1.7976931348623157E308"> <font> - <Font name="System Bold" size="16.0" /> + <Font size="1.0" /> </font> </Label> - <Region prefWidth="200.0" HBox.hgrow="ALWAYS" /> - <Button fx:id="buttonCategoryAll" mnemonicParsing="false" onAction="#enableAllCategories" text="%filter.categories.button.all"> - <font> - <Font name="System Bold" size="13.0" /> - </font> - </Button> - <Button fx:id="buttonCategoryNone" mnemonicParsing="false" onAction="#disableAllCategories" text="%filter.categories.button.none"> - <font> - <Font name="System Bold" size="13.0" /> - </font> - </Button> + <VBox prefHeight="150.0" prefWidth="422.0" spacing="5.0" VBox.vgrow="ALWAYS"> + <children> + <HBox spacing="10.0"> + <children> + <Label maxWidth="1.7976931348623157E308" text="%filter.tags" HBox.hgrow="ALWAYS"> + <font> + <Font name="System Bold" size="16.0" /> + </font> + </Label> + <Button fx:id="buttonTagsAll" mnemonicParsing="false" onAction="#enableAllTags" text="%filter.categories.button.all"> + <font> + <Font name="System Bold" size="13.0" /> + </font> + </Button> + <Button fx:id="buttonTagsNone" mnemonicParsing="false" onAction="#disableAllTags" text="%filter.categories.button.none"> + <font> + <Font name="System Bold" size="13.0" /> + </font> + </Button> + </children> + </HBox> + <ScrollPane prefHeight="85.0" prefWidth="409.0" VBox.vgrow="ALWAYS"> + <content> + <VBox fx:id="vboxTags" spacing="5.0" /> + </content> + </ScrollPane> + </children> + <padding> + <Insets left="10.0" /> + </padding> + </VBox> </children> - </HBox> - <ScrollPane prefHeight="88.0" prefWidth="409.0" VBox.vgrow="ALWAYS"> - <content> - <VBox fx:id="vboxCategories" spacing="5.0" /> - </content> - </ScrollPane> + </VBox> </children> - </VBox> + </HBox> <VBox prefHeight="33.0" prefWidth="422.0" spacing="5.0"> <children> <Label text="%filter.name"> @@ -116,35 +177,6 @@ <TextField fx:id="textFieldSearch" /> </children> </VBox> - <VBox prefHeight="150.0" prefWidth="422.0" spacing="5.0" VBox.vgrow="ALWAYS"> - <children> - <HBox spacing="10.0"> - <children> - <Label text="%filter.tags"> - <font> - <Font name="System Bold" size="16.0" /> - </font> - </Label> - <Region prefWidth="200.0" HBox.hgrow="ALWAYS" /> - <Button fx:id="buttonTagsAll" mnemonicParsing="false" onAction="#enableAllTags" text="%filter.categories.button.all"> - <font> - <Font name="System Bold" size="13.0" /> - </font> - </Button> - <Button fx:id="buttonTagsNone" mnemonicParsing="false" onAction="#disableAllTags" text="%filter.categories.button.none"> - <font> - <Font name="System Bold" size="13.0" /> - </font> - </Button> - </children> - </HBox> - <ScrollPane prefHeight="85.0" prefWidth="409.0" VBox.vgrow="ALWAYS"> - <content> - <VBox fx:id="vboxTags" spacing="5.0" /> - </content> - </ScrollPane> - </children> - </VBox> <HBox alignment="CENTER" prefHeight="30.0" prefWidth="465.0" spacing="10.0"> <children> <Button fx:id="buttonCancel" mnemonicParsing="false" onAction="#cancel" text="%cancel"> -- GitLab