From 091066de356c47a55bcff8cd3aaf4b1d66022ee4 Mon Sep 17 00:00:00 2001 From: mkpaz Date: Sat, 27 May 2023 22:12:06 +0400 Subject: [PATCH] Add edge-to-edge tweak support to Card --- .../src/main/java/atlantafx/sampler/layout/ModalDialog.java | 2 ++ .../atlantafx/sampler/page/general/SceneBuilderDialog.java | 3 +++ .../atlantafx/sampler/assets/styles/scss/layout/_root.scss | 3 +-- styles/src/components/_card.scss | 6 ++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sampler/src/main/java/atlantafx/sampler/layout/ModalDialog.java b/sampler/src/main/java/atlantafx/sampler/layout/ModalDialog.java index e374907..224bc3a 100644 --- a/sampler/src/main/java/atlantafx/sampler/layout/ModalDialog.java +++ b/sampler/src/main/java/atlantafx/sampler/layout/ModalDialog.java @@ -7,6 +7,7 @@ import atlantafx.base.controls.ModalPane; import atlantafx.base.controls.Spacer; import atlantafx.base.controls.Tile; import atlantafx.base.layout.ModalBox; +import atlantafx.base.theme.Tweaks; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; @@ -32,6 +33,7 @@ public abstract class ModalDialog extends ModalBox { protected void createView() { content.setHeader(header); + content.getStyleClass().add(Tweaks.EDGE_TO_EDGE); // IMPORTANT: this guarantees client will use correct width and height setMinWidth(USE_PREF_SIZE); diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/SceneBuilderDialog.java b/sampler/src/main/java/atlantafx/sampler/page/general/SceneBuilderDialog.java index 327e581..fc76280 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/SceneBuilderDialog.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/SceneBuilderDialog.java @@ -39,6 +39,7 @@ import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; import javafx.scene.layout.VBox; import javafx.stage.DirectoryChooser; import javafx.util.Duration; @@ -201,6 +202,8 @@ class SceneBuilderDialog extends ModalDialog { Installation files will be overwritten, but you can rollback changes using the same dialog again. """); noticeLbl.setWrapText(true); + noticeLbl.setMaxWidth(Region.USE_PREF_SIZE); + noticeLbl.setMinHeight(Region.USE_PREF_SIZE); // ~ diff --git a/sampler/src/main/resources/atlantafx/sampler/assets/styles/scss/layout/_root.scss b/sampler/src/main/resources/atlantafx/sampler/assets/styles/scss/layout/_root.scss index cabe36b..3d36a1e 100644 --- a/sampler/src/main/resources/atlantafx/sampler/assets/styles/scss/layout/_root.scss +++ b/sampler/src/main/resources/atlantafx/sampler/assets/styles/scss/layout/_root.scss @@ -69,11 +69,10 @@ .modal-dialog { -fx-background-color: transparent; - -fx-border-width: 2; + -fx-border-width: 1; -fx-border-color: -color-border-default; .card { - -fx-border-width: 0; -fx-padding: 10px 20px 10px 20px; } } diff --git a/styles/src/components/_card.scss b/styles/src/components/_card.scss index 9ce7cc9..0eb1394 100644 --- a/styles/src/components/_card.scss +++ b/styles/src/components/_card.scss @@ -53,3 +53,9 @@ $spacing: 10px !default; -fx-background-radius: 0; } } + +.edge-to-edge>.card { + -fx-border-width: 0; + -fx-border-radius: 0; + -fx-effect: none; +}