Support disabled state for Tile-based controls

This commit is contained in:
mkpaz 2023-05-30 13:27:31 +04:00
parent c1f9a76e1e
commit 119f13711c
4 changed files with 43 additions and 2 deletions

@ -194,7 +194,10 @@ public class NotificationPage extends OutlinePage {
you can easily implement it by using the [i]StackPane[/i] layout.""" you can easily implement it by using the [i]StackPane[/i] layout."""
); );
return new ExampleBox(box, new Snippet(getClass(), 4), description); var example = new ExampleBox(box, new Snippet(getClass(), 4), description);
example.setAllowDisable(false);
return example;
} }
private Node elevationExample() { private Node elevationExample() {

@ -52,11 +52,23 @@ $title-font-size: cfg.$font-title-4;
&.interactive:hover { &.interactive:hover {
@include effects.shadow(cfg.$elevation-color, cfg.$elevation-interactive); @include effects.shadow(cfg.$elevation-color, cfg.$elevation-interactive);
} }
TextFlow {
Text {
&:disabled {
-fx-opacity: cfg.$opacity-disabled;
}
}
}
} }
&:has-image { &:has-image {
>.container >.sub-header { >.container >.sub-header {
-fx-padding: 0; -fx-padding: 0;
&:disabled {
-fx-opacity: cfg.$opacity-disabled;
}
} }
} }

@ -95,6 +95,12 @@ $close-button-padding: 0.5em; // private variable
-fx-border-width: cfg.$border-width; -fx-border-width: cfg.$border-width;
-fx-border-radius: cfg.$border-radius; -fx-border-radius: cfg.$border-radius;
>.graphic {
&:disabled {
-fx-opacity: cfg.$opacity-disabled;
}
}
>.header { >.header {
>.title { >.title {
-fx-text-fill: -color-message-fg-secondary; -fx-text-fill: -color-message-fg-secondary;
@ -103,6 +109,10 @@ $close-button-padding: 0.5em; // private variable
>.description { >.description {
Text { Text {
-fx-fill: -color-message-fg-secondary; -fx-fill: -color-message-fg-secondary;
&:disabled {
-fx-opacity: cfg.$opacity-disabled;
}
} }
} }
} }
@ -153,6 +163,10 @@ $close-button-padding: 0.5em; // private variable
-fx-background-color: -color-message-border, -color-message-button-hover; -fx-background-color: -color-message-border, -color-message-button-hover;
-fx-background-insets: 0, 1; -fx-background-insets: 0, 1;
} }
&:disabled {
-fx-opacity: cfg.$opacity-disabled;
}
} }
&:closeable { &:closeable {

@ -13,7 +13,11 @@ $title-font-size: 1.05em !default; // semibold would be much better, but it's Ja
-fx-background-radius: cfg.$border-radius; -fx-background-radius: cfg.$border-radius;
-fx-spacing: 1em; -fx-spacing: 1em;
// >.graphic {} >.graphic {
&:disabled {
-fx-opacity: cfg.$opacity-disabled;
}
}
>.header { >.header {
-fx-alignment: CENTER_LEFT; -fx-alignment: CENTER_LEFT;
@ -22,6 +26,14 @@ $title-font-size: 1.05em !default; // semibold would be much better, but it's Ja
>.title { >.title {
-fx-font-size: $title-font-size; -fx-font-size: $title-font-size;
} }
>.description {
Text {
&:disabled {
-fx-opacity: cfg.$opacity-disabled;
}
}
}
} }
// >.action {} // >.action {}