From f2f7618a295db55d5df03433ba1e836f06f0f6f4 Mon Sep 17 00:00:00 2001 From: crschnick Date: Sun, 18 May 2025 14:46:42 +0000 Subject: [PATCH] Small styling fixes --- .../main/java/io/xpipe/app/core/AppTheme.java | 29 ++++++++++++++----- .../xpipe/app/prefs/AppearanceCategory.java | 21 ++++++++++---- .../io/xpipe/app/util/ScanDialogBase.java | 2 +- .../xpipe/app/resources/style/popup-menu.css | 12 ++++++-- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/core/AppTheme.java b/app/src/main/java/io/xpipe/app/core/AppTheme.java index ee9a894d7..03b0cbccc 100644 --- a/app/src/main/java/io/xpipe/app/core/AppTheme.java +++ b/app/src/main/java/io/xpipe/app/core/AppTheme.java @@ -265,8 +265,9 @@ public class AppTheme { Color baseColor, Color borderColor, Supplier 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 contextMenuColor; + @Getter + protected final int displayBorderRadius; + static Theme getDefaultLightTheme() { return switch (OsType.getLocal()) { case OsType.Windows windows -> PRIMER_LIGHT; diff --git a/app/src/main/java/io/xpipe/app/prefs/AppearanceCategory.java b/app/src/main/java/io/xpipe/app/prefs/AppearanceCategory.java index 398ccd514..9411a7612 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppearanceCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppearanceCategory.java @@ -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); diff --git a/app/src/main/java/io/xpipe/app/util/ScanDialogBase.java b/app/src/main/java/io/xpipe/app/util/ScanDialogBase.java index d684c748c..52a7b52bc 100644 --- a/app/src/main/java/io/xpipe/app/util/ScanDialogBase.java +++ b/app/src/main/java/io/xpipe/app/util/ScanDialogBase.java @@ -125,7 +125,7 @@ public class ScanDialogBase { Function nameFunc = (ScanProvider.ScanOpportunity s) -> { var n = AppI18n.get(s.getNameKey()); - if (s.getLicensedFeatureId() == null) { + if (s.getLicensedFeatureId() == null || s.isDisabled()) { return n; } diff --git a/app/src/main/resources/io/xpipe/app/resources/style/popup-menu.css b/app/src/main/resources/io/xpipe/app/resources/style/popup-menu.css index 7456cffc8..1ace30ae3 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/popup-menu.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/popup-menu.css @@ -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;