From 20305b5b1d9a36466aabc8b822d70547b293b561 Mon Sep 17 00:00:00 2001 From: mkpaz Date: Thu, 25 May 2023 21:33:30 +0400 Subject: [PATCH] Add edge-to-edge tweak support to Calendar --- .../sampler/page/components/PopoverPage.java | 19 ++----------------- .../assets/fxml/blueprints/calendar.fxml | 2 +- .../assets/styles/scss/page/_showcase.scss | 4 ---- styles/src/components/_date-picker.scss | 6 ++++++ 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/PopoverPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/PopoverPage.java index 372a52b..aa62ac9 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/PopoverPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/PopoverPage.java @@ -5,7 +5,7 @@ package atlantafx.sampler.page.components; import atlantafx.base.controls.Calendar; import atlantafx.base.controls.Popover; import atlantafx.base.controls.Popover.ArrowLocation; -import atlantafx.base.theme.Styles; +import atlantafx.base.theme.Tweaks; import atlantafx.base.util.BBCodeParser; import atlantafx.sampler.page.ExampleBox; import atlantafx.sampler.page.OutlinePage; @@ -51,16 +51,6 @@ public final class PopoverPage extends OutlinePage { } private ExampleBox usageExample() { - var dataClass = """ - .popover .date-picker-popup { - -color-date-border: transparent; - -color-date-bg: transparent; - -color-date-day-bg: transparent; - -color-date-month-year-bg: transparent; - -color-date-day-bg-hover: -color-bg-subtle; - } - """; - //snippet_1:start var textFlow = new TextFlow(new Text( FAKER.lorem().sentence(30) @@ -79,12 +69,7 @@ public final class PopoverPage extends OutlinePage { // ~ var cal = new Calendar(); cal.setValue(LocalDate.now(ZoneId.systemDefault())); - // -color-date-border: transparent; - // -color-date-bg: transparent; - // -color-date-day-bg: transparent; - // -color-date-month-year-bg: transparent; - // -color-date-day-bg-hover: -color-bg-subtle; - cal.getStylesheets().add(Styles.toDataURI(dataClass)); + cal.getStyleClass().add(Tweaks.EDGE_TO_EDGE); var pop2 = new Popover(cal); pop2.setHeaderAlwaysVisible(false); diff --git a/sampler/src/main/resources/atlantafx/sampler/assets/fxml/blueprints/calendar.fxml b/sampler/src/main/resources/atlantafx/sampler/assets/fxml/blueprints/calendar.fxml index 8f888de..083aefc 100644 --- a/sampler/src/main/resources/atlantafx/sampler/assets/fxml/blueprints/calendar.fxml +++ b/sampler/src/main/resources/atlantafx/sampler/assets/fxml/blueprints/calendar.fxml @@ -57,7 +57,7 @@ - +