More style refactoring for tiled collections.

This commit is contained in:
Andrew Lalis 2024-01-08 11:49:02 -05:00
parent 8a43862725
commit a94666a8d6
9 changed files with 49 additions and 20 deletions

View File

@ -61,6 +61,9 @@ public class PerfinApp extends Application {
Platform.runLater(() -> { Platform.runLater(() -> {
stage.hide(); stage.hide();
Scene mainViewScene = SceneUtil.load("/main-view.fxml"); Scene mainViewScene = SceneUtil.load("/main-view.fxml");
mainViewScene.getStylesheets().addAll(
PerfinApp.class.getResource("/style/base.css").toExternalForm()
);
stage.setScene(mainViewScene); stage.setScene(mainViewScene);
stage.setTitle("Perfin"); stage.setTitle("Perfin");
stage.getIcons().add(ImageCache.getLogo64()); stage.getIcons().add(ImageCache.getLogo64());

View File

@ -1,5 +1,6 @@
package com.andrewlalis.perfin.view; package com.andrewlalis.perfin.view;
import javafx.scene.Scene;
import javafx.stage.Modality; import javafx.stage.Modality;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.Window; import javafx.stage.Window;
@ -15,7 +16,11 @@ public class ProfilesStage extends Stage {
setTitle("Profiles"); setTitle("Profiles");
setAlwaysOnTop(false); setAlwaysOnTop(false);
initModality(Modality.APPLICATION_MODAL); initModality(Modality.APPLICATION_MODAL);
setScene(SceneUtil.load("/profiles-view.fxml")); Scene scene = SceneUtil.load("/profiles-view.fxml");
scene.getStylesheets().addAll(
ProfilesStage.class.getResource("/style/base.css").toExternalForm()
);
setScene(scene);
} }
public static void open(Window owner) { public static void open(Window owner) {

View File

@ -63,8 +63,8 @@
<VBox VBox.vgrow="ALWAYS"> <VBox VBox.vgrow="ALWAYS">
<Label text="History" styleClass="bold-text,std-padding"/> <Label text="History" styleClass="bold-text,std-padding"/>
<VBox> <VBox>
<ScrollPane fitToHeight="true" fitToWidth="true"> <ScrollPane styleClass="tile-container-scroll">
<VBox fx:id="historyItemsVBox" styleClass="padding-extra-1,spacing-extra-1"/> <VBox fx:id="historyItemsVBox" styleClass="tile-container"/>
</ScrollPane> </ScrollPane>
<AnchorPane> <AnchorPane>
<Button <Button

View File

@ -16,11 +16,11 @@
</HBox> </HBox>
</top> </top>
<center> <center>
<VBox> <VBox BorderPane.alignment="TOP_LEFT">
<ScrollPane fitToHeight="true" fitToWidth="true" VBox.vgrow="ALWAYS"> <ScrollPane styleClass="tile-container-scroll" VBox.vgrow="ALWAYS">
<FlowPane fx:id="accountsPane" BorderPane.alignment="TOP_LEFT" vgap="10" hgap="10" styleClass="padding-extra-1"/> <FlowPane fx:id="accountsPane" styleClass="tile-container"/>
</ScrollPane> </ScrollPane>
<Label fx:id="noAccountsLabel" BorderPane.alignment="TOP_LEFT" styleClass="std-padding" text="No accounts have been added to this profile."/> <Label fx:id="noAccountsLabel" styleClass="std-padding" text="No accounts have been added to this profile."/>
</VBox> </VBox>
</center> </center>
</BorderPane> </BorderPane>

View File

@ -7,7 +7,6 @@
xmlns:fx="http://javafx.com/fxml" xmlns:fx="http://javafx.com/fxml"
fx:id="mainContainer" fx:id="mainContainer"
fx:controller="com.andrewlalis.perfin.control.MainViewController" fx:controller="com.andrewlalis.perfin.control.MainViewController"
stylesheets="@style/base.css"
> >
<top> <top>
<VBox> <VBox>

View File

@ -9,24 +9,31 @@
<BorderPane xmlns="http://javafx.com/javafx" <BorderPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml" xmlns:fx="http://javafx.com/fxml"
fx:controller="com.andrewlalis.perfin.control.ProfilesViewController" fx:controller="com.andrewlalis.perfin.control.ProfilesViewController"
stylesheets="@style/base.css"
prefWidth="500" prefWidth="500"
prefHeight="400" prefHeight="400"
> >
<top> <top>
<VBox styleClass="std-padding,std-spacing"> <VBox styleClass="padding-extra-1,std-spacing">
<TextFlow> <TextFlow>
<Text text="In Perfin, all your accounts, transactions, files, and other financial data are stored in a single "/> <Text>
<Text text="profile" styleClass="bold-text"/> In Perfin, all your accounts, transactions, attachment files,
<Text text=". By default, Perfin uses the "/> and other financial data are stored in a single
<Text text="default" style="-fx-font-style: italic;"/> </Text>
<Text text=" profile, and this should be sufficient for most users, but you can also add new profiles if you'd like to track some finances separately."/> <Text styleClass="italic-text">&#160;profile</Text>
<Text>.</Text>
</TextFlow>
<TextFlow>
<Text>
Usually, a single profile will be sufficient for most users,
but you can add new profiles if you'd like to track certain
finances separately.
</Text>
</TextFlow> </TextFlow>
</VBox> </VBox>
</top> </top>
<center> <center>
<ScrollPane fitToWidth="true" fitToHeight="true"> <ScrollPane fitToWidth="true" fitToHeight="true">
<VBox fx:id="profilesVBox" styleClass="std-padding,spacing-extra"/> <VBox fx:id="profilesVBox" styleClass="tile-container"/>
</ScrollPane> </ScrollPane>
</center> </center>
<bottom> <bottom>

View File

@ -23,10 +23,14 @@ rather than with your own CSS.
-fx-font-family: "Roboto", sans-serif; -fx-font-family: "Roboto", sans-serif;
-fx-font-size: 14px; -fx-font-size: 14px;
-fx-text-fill: -fx-theme-text; -fx-text-fill: -fx-theme-text;
-fx-fill: -fx-theme-text;
-fx-background-color: -fx-theme-background; -fx-background-color: -fx-theme-background;
} }
Text {
-fx-fill: -fx-theme-text;
}
/* Font/text styles */
.mono-font { .mono-font {
-fx-font-family: "JetBrains Mono", monospace; -fx-font-family: "JetBrains Mono", monospace;
} }
@ -86,6 +90,17 @@ rather than with your own CSS.
} }
/* Standard "tile" styling. */ /* Standard "tile" styling. */
.tile-container {
-fx-padding: 10px;
-fx-spacing: 10px;
-fx-hgap: 10px;
-fx-vgap: 10px;
}
.tile-container-scroll {
-fx-fit-to-height: true;
-fx-fit-to-width: true;
}
.tile { .tile {
-fx-background-color: -fx-theme-background-2; -fx-background-color: -fx-theme-background-2;
-fx-padding: 10px; -fx-padding: 10px;

View File

@ -13,7 +13,7 @@
-fx-background-color: transparent; -fx-background-color: transparent;
-fx-border-style: none; -fx-border-style: none;
-fx-border-color: transparent; -fx-border-color: transparent;
-fx-text-fill: white; -fx-text-fill: -fx-theme-background;
-fx-padding: 0; -fx-padding: 0;
} }

View File

@ -27,8 +27,8 @@
</HBox> </HBox>
</top> </top>
<center> <center>
<ScrollPane fitToHeight="true" fitToWidth="true"> <ScrollPane styleClass="tile-container-scroll">
<VBox fx:id="transactionsVBox" styleClass="padding-extra-1,spacing-extra-1"/> <VBox fx:id="transactionsVBox" styleClass="tile-container"/>
</ScrollPane> </ScrollPane>
</center> </center>
</BorderPane> </BorderPane>