From 59963238999295e3900a66460edbf5fa57c4aa72 Mon Sep 17 00:00:00 2001 From: mkpaz Date: Thu, 25 Aug 2022 16:32:31 +0400 Subject: [PATCH] Change radio button style --- .../atlantafx/sampler/page/components/OverviewPage.java | 4 ++-- styles/src/components/_checkbox.scss | 2 +- styles/src/components/_radio.scss | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/OverviewPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/OverviewPage.java index 819cace..6ed9dc5 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/components/OverviewPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/OverviewPage.java @@ -181,7 +181,7 @@ public class OverviewPage extends AbstractPage { var opt1 = new CheckBox("Option 1"); - var opt2 = new CheckBox("Option 1"); + var opt2 = new CheckBox("Option 2"); opt2.setSelected(true); var opt3 = new CheckBox("Option 3"); @@ -200,7 +200,7 @@ public class OverviewPage extends AbstractPage { var opt1 = new RadioButton("Option 1"); opt1.setToggleGroup(group); - var opt2 = new RadioButton("Option 1"); + var opt2 = new RadioButton("Option 2"); opt2.setToggleGroup(group); opt2.setSelected(true); diff --git a/styles/src/components/_checkbox.scss b/styles/src/components/_checkbox.scss index 202de87..bddb8a5 100755 --- a/styles/src/components/_checkbox.scss +++ b/styles/src/components/_checkbox.scss @@ -7,7 +7,7 @@ // applied to label -fx-text-fill: -color-fg-default; - -fx-label-padding: cfg.$checkbox-label-padding cfg.$checkbox-label-padding cfg.$checkbox-label-padding cfg.$graphic-gap; + -fx-label-padding: cfg.$checkbox-label-padding cfg.$checkbox-label-padding 0 cfg.$graphic-gap; >.box { -fx-background-color: -color-fg-default, -color-bg-default; diff --git a/styles/src/components/_radio.scss b/styles/src/components/_radio.scss index da44f0a..89b72a2 100755 --- a/styles/src/components/_radio.scss +++ b/styles/src/components/_radio.scss @@ -7,7 +7,7 @@ // applied to label -fx-background-color: -color-bg-default; -fx-text-fill: -color-fg-default; - -fx-label-padding: cfg.$checkbox-label-padding cfg.$checkbox-label-padding cfg.$checkbox-label-padding cfg.$graphic-gap; + -fx-label-padding: cfg.$checkbox-label-padding cfg.$checkbox-label-padding 0 cfg.$graphic-gap; >.radio { -fx-background-color: -color-fg-default, -color-bg-default; @@ -17,7 +17,8 @@ -fx-alignment: CENTER; >.dot { - -fx-background-color: transparent; + -fx-background-color: transparent, transparent; + -fx-background-insets: 0, 1px; -fx-background-radius: 1em; // large value to make sure this remains circular -fx-min-height: cfg.$checkbox-mark-size; -fx-max-height: cfg.$checkbox-mark-size; @@ -36,10 +37,10 @@ &:selected { >.radio { - -fx-background-color: -color-accent-emphasis, -color-bg-default; + -fx-background-color: -color-accent-emphasis; >.dot { - -fx-background-color: -color-accent-emphasis; + -fx-background-color: -color-accent-emphasis, -color-fg-emphasis; } } }