Small styling fixes

This commit is contained in:
crschnick
2025-05-18 14:46:42 +00:00
parent 462fdc1cae
commit f2f7618a29
4 changed files with 47 additions and 17 deletions
@@ -265,8 +265,9 @@ public class AppTheme {
Color baseColor,
Color borderColor,
Supplier<Color> contextMenuColor,
int displayBorderRadius,
int skipLines) {
super(id, cssId, theme, sizes, baseColor, borderColor, contextMenuColor);
super(id, cssId, theme, sizes, baseColor, borderColor, contextMenuColor, displayBorderRadius);
this.name = name;
this.skipLines = skipLines;
}
@@ -316,7 +317,8 @@ public class AppTheme {
.darker()
.desaturate()
.brighter(),
0.3));
0.3),
4);
public static final Theme PRIMER_DARK = new Theme(
"dark",
"primer",
@@ -330,7 +332,8 @@ public class AppTheme {
.desaturate()
.desaturate()
.darker(),
0.2));
0.2),
4);
public static final Theme NORD_LIGHT = new Theme(
"nordLight",
"nord",
@@ -344,7 +347,8 @@ public class AppTheme {
.darker()
.desaturate()
.brighter(),
0.3));
0.3),
0);
public static final Theme NORD_DARK = new Theme(
"nordDark",
"nord",
@@ -358,7 +362,8 @@ public class AppTheme {
.desaturate()
.desaturate()
.darker(),
0.2));
0.2),
0);
public static final Theme CUPERTINO_LIGHT = new Theme(
"cupertinoLight",
"cupertino",
@@ -372,7 +377,8 @@ public class AppTheme {
.darker()
.desaturate()
.brighter(),
0.3));
0.3),
4);
public static final Theme CUPERTINO_DARK = new Theme(
"cupertinoDark",
"cupertino",
@@ -386,7 +392,8 @@ public class AppTheme {
.desaturate()
.desaturate()
.darker(),
0.2));
0.2),
4);
public static final Theme DRACULA = new Theme(
"dracula",
"dracula",
@@ -400,7 +407,8 @@ public class AppTheme {
.desaturate()
.desaturate()
.darker(),
0.2));
0.2),
6);
public static final Theme MOCHA = new DerivedTheme(
"mocha",
"mocha",
@@ -416,6 +424,7 @@ public class AppTheme {
.desaturate()
.darker(),
0.2),
4,
91);
// Adjust this to create your own theme
@@ -429,6 +438,7 @@ public class AppTheme {
Color.web("#24292f"),
() -> ColorHelper.withOpacity(
Platform.getPreferences().getAccentColor().desaturate().desaturate(), 0.2),
4,
91);
// Also include your custom theme here
@@ -453,6 +463,9 @@ public class AppTheme {
@Getter
protected final Supplier<Color> contextMenuColor;
@Getter
protected final int displayBorderRadius;
static Theme getDefaultLightTheme() {
return switch (OsType.getLocal()) {
case OsType.Windows windows -> PRIMER_LIGHT;
@@ -21,6 +21,7 @@ import javafx.scene.shape.Circle;
import atlantafx.base.controls.ProgressSliderSkin;
import atlantafx.base.theme.Styles;
import javafx.scene.shape.Rectangle;
import org.kordamp.ikonli.javafx.FontIcon;
import java.util.Arrays;
@@ -81,15 +82,25 @@ public class AppearanceCategory extends AppPrefsCategory {
@Override
protected void updateItem(AppTheme.Theme theme, boolean empty) {
super.updateItem(theme, empty);
setText(theme != null ? theme.toTranslatedString().getValue() : null);
if (theme == null) {
setText(null);
setGraphic(null);
return;
}
var b = new Circle(7);
setText(theme.toTranslatedString().getValue());
var b = new Rectangle(8, 8);
b.setArcWidth(theme.getDisplayBorderRadius());
b.setArcHeight(theme.getDisplayBorderRadius());
b.getStyleClass().add("dot");
b.setFill(theme != null ? theme.getBaseColor() : Color.TRANSPARENT);
b.setFill(theme.getBaseColor());
var d = new Circle(8);
var d = new Rectangle(10, 10);
d.setArcWidth(theme.getDisplayBorderRadius() + 2);
d.setArcHeight(theme.getDisplayBorderRadius() + 2);
d.getStyleClass().add("dot");
d.setFill(theme != null ? theme.getBorderColor() : Color.TRANSPARENT);
d.setFill(theme.getBorderColor());
d.setFill(Color.GRAY);
var s = new StackPane(d, b);
@@ -125,7 +125,7 @@ public class ScanDialogBase {
Function<ScanProvider.ScanOpportunity, String> nameFunc = (ScanProvider.ScanOpportunity s) -> {
var n = AppI18n.get(s.getNameKey());
if (s.getLicensedFeatureId() == null) {
if (s.getLicensedFeatureId() == null || s.isDisabled()) {
return n;
}
@@ -51,12 +51,18 @@
}
.context-menu {
-fx-padding: 12 0 12 0;
-fx-background-radius: 8px;
-fx-border-radius: 8px;
-fx-padding: 4 0 4 0;
-fx-background-radius: 4px;
-fx-border-radius: 4px;
-fx-border-color: -color-border-default;
}
.root.nord .context-menu {
-fx-padding: 0;
-fx-background-radius:0;
-fx-border-radius: 0;
}
.context-menu * .context-menu, .context-menu.condensed {
-fx-padding: 0;
-fx-background-radius: 0;