From 083ac8a0a7d2a76cf31463e77d242f6546aca6b7 Mon Sep 17 00:00:00 2001 From: mkpaz Date: Tue, 30 May 2023 15:49:01 +0400 Subject: [PATCH] Fix minor theme styling issues --- .../sampler/page/showcase/OverviewPage.java | 10 ++++++++++ .../atlantafx/sampler/fxml/overview.fxml | 7 +++++-- styles/src/components/_data.scss | 18 +++++++++++++++++- styles/src/cupertino-dark.scss | 8 +------- styles/src/cupertino-light.scss | 8 +------- styles/src/dracula.scss | 13 +++---------- 6 files changed, 37 insertions(+), 27 deletions(-) diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/OverviewPage.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/OverviewPage.java index 7f8f9ca..6cf1a3e 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/OverviewPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/OverviewPage.java @@ -4,6 +4,7 @@ package atlantafx.sampler.page.showcase; import static javafx.scene.control.ScrollPane.ScrollBarPolicy.AS_NEEDED; +import atlantafx.base.controls.Breadcrumbs; import atlantafx.base.controls.MaskTextField; import atlantafx.base.theme.Styles; import atlantafx.sampler.Resources; @@ -13,6 +14,7 @@ import java.io.IOException; import java.net.URI; import java.net.URL; import java.util.ResourceBundle; +import java.util.stream.Stream; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; @@ -89,10 +91,18 @@ public final class OverviewPage extends ScrollPane implements Page { public static class Controller implements Initializable { public @FXML MaskTextField phoneTf; + public @FXML Breadcrumbs breadcrumbs; @Override public void initialize(URL url, ResourceBundle resourceBundle) { phoneTf.setText("(415) 273-91-64"); + var items = Stream.generate(() -> FAKER.science().element()) + .limit(3) + .toList(); + Breadcrumbs.BreadCrumbItem root = Breadcrumbs.buildTreeModel( + items.toArray(String[]::new) + ); + breadcrumbs.setSelectedCrumb(root); } } } diff --git a/sampler/src/main/resources/atlantafx/sampler/fxml/overview.fxml b/sampler/src/main/resources/atlantafx/sampler/fxml/overview.fxml index f28d812..683a65c 100644 --- a/sampler/src/main/resources/atlantafx/sampler/fxml/overview.fxml +++ b/sampler/src/main/resources/atlantafx/sampler/fxml/overview.fxml @@ -1,5 +1,6 @@ + @@ -210,6 +211,7 @@ + @@ -223,9 +225,10 @@ - + + @@ -583,7 +586,7 @@ - + diff --git a/styles/src/components/_data.scss b/styles/src/components/_data.scss index f9c902b..68b48c4 100755 --- a/styles/src/components/_data.scss +++ b/styles/src/components/_data.scss @@ -20,6 +20,10 @@ $color-resize-line: -color-accent-emphasis !default; $color-drag-header: -color-accent-muted !default; $color-drag-overlay: -color-accent-muted !default; +// warning: setting header size in 'em' sometimes breaks borders +$header-size-normal: 40px !default; +$header-size-dense: 34px !default; + $cell-size-normal: 2.8em !default; $cell-size-dense: 2em !default; $cell-padding-x: 0.5em !default; @@ -250,7 +254,7 @@ $tree-cell-indent: 1.2em !default; // default JavaFX values is 18px .column-header { -fx-background-color: transparent; -fx-background-insets: 0; - -fx-size: 2.2em; + -fx-size: $header-size-normal; -fx-padding: 0; -fx-font-weight: bold; -fx-border-color: -color-cell-border; @@ -358,6 +362,12 @@ $tree-cell-indent: 1.2em !default; // default JavaFX values is 18px } &.dense { + >.column-header-background { + .column-header { + -fx-size: $header-size-dense; + } + } + .table-row-cell { -fx-cell-size: $cell-size-dense; } @@ -530,6 +540,12 @@ $tree-cell-indent: 1.2em !default; // default JavaFX values is 18px } &.dense { + >.column-header-background { + .column-header { + -fx-size: $header-size-dense; + } + } + .tree-table-row-cell { -fx-cell-size: $cell-size-dense; diff --git a/styles/src/cupertino-dark.scss b/styles/src/cupertino-dark.scss index 2945d9d..803b32a 100755 --- a/styles/src/cupertino-dark.scss +++ b/styles/src/cupertino-dark.scss @@ -183,13 +183,7 @@ $opaqueSeparator: rgba(56.0, 56.0, 58.0, 1.0); // #38383aff ); @forward "components/date-picker" as date-picker-* with ( - $cell-padding-x: 2px, - $cell-padding-y: 2px, - $cell-size: 2.5em, - $color-icon: -color-accent-fg, - $day-cell-font-size: 0.85em, - $day-name-font-size: 0.9em, - $month-year-font-size: 1em + $color-icon: -color-accent-fg, ); @forward "components/menu" as menu-* with ( diff --git a/styles/src/cupertino-light.scss b/styles/src/cupertino-light.scss index dac50c5..152ebc1 100755 --- a/styles/src/cupertino-light.scss +++ b/styles/src/cupertino-light.scss @@ -184,13 +184,7 @@ $opaqueSeparator: rgba(198.0, 198.0, 200.0, 1.0); // #c6c6c8ff ); @forward "components/date-picker" as date-picker-* with ( - $cell-padding-x: 2px, - $cell-padding-y: 2px, - $cell-size: 2.5em, - $color-icon: -color-accent-fg, - $day-cell-font-size: 0.85em, - $day-name-font-size: 0.9em, - $month-year-font-size: 1em + $color-icon: -color-accent-fg, ); @forward "components/menu" as menu-* with ( diff --git a/styles/src/dracula.scss b/styles/src/dracula.scss index 2a9cba4..340069f 100755 --- a/styles/src/dracula.scss +++ b/styles/src/dracula.scss @@ -187,19 +187,11 @@ $ui-yellowLight: hsla(60, 100%, 75%, 5%); ); @forward "components/data" as data-* with ( - $color-header-bg: -color-bg-default, - $color-header-fg: -color-fg-muted, $color-cell-bg-selected: -color-accent-subtle ); @forward "components/date-picker" as date-picker-* with ( - $cell-padding-x: 2px, - $cell-padding-y: 2px, - $cell-size: 2.5em, - $color-icon: -color-accent-fg, - $day-cell-font-size: 0.85em, - $day-name-font-size: 0.9em, - $month-year-font-size: 1em + $color-icon: -color-accent-fg, ); @forward "components/menu" as menu-* with ( @@ -233,7 +225,8 @@ $ui-yellowLight: hsla(60, 100%, 75%, 5%); ); @forward "components/tab-pane" as tab-pane-* with ( - $color-lr-bg-selected: -color-base-6 + $color-lr-bg-selected: -color-base-6, + $color-tb-border-selected: -color-warning-emphasis, ); @forward "components/text-input" as text-input-* with (