diff --git a/desktop/src/main/java/bisq/desktop/bisq.css b/desktop/src/main/java/bisq/desktop/bisq.css index eb7ba927c99..24f389dd539 100644 --- a/desktop/src/main/java/bisq/desktop/bisq.css +++ b/desktop/src/main/java/bisq/desktop/bisq.css @@ -1645,12 +1645,12 @@ textfield */ #buy-button-big { -fx-font-size: 1em; -fx-background-color: -bs-buy; - -fx-text-fill: white; + -fx-text-fill: -bs-white; } #buy-button { -fx-background-color: -bs-buy; - -fx-text-fill: white !important; + -fx-text-fill: -bs-white; } #buy-button-big:hover, #buy-button:hover, @@ -1660,13 +1660,13 @@ textfield */ #sell-button-big { -fx-background-color: -bs-sell; - -fx-text-fill: white; + -fx-text-fill: -bs-white; -fx-font-size: 1em; } #sell-button { -fx-background-color: -bs-sell; - -fx-text-fill: white !important; + -fx-text-fill: -bs-white; } #sell-button-big:hover, #sell-button:hover, diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java index c0b3141d492..8f0ff34636d 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java @@ -37,6 +37,7 @@ import bisq.desktop.main.offer.OfferView; import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.overlays.windows.OfferDetailsWindow; +import bisq.desktop.util.CssTheme; import bisq.desktop.util.DisplayUtils; import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; @@ -1002,11 +1003,13 @@ public void updateItem(final OfferBookListItem newItem, boolean empty) { iconView.setId("image-remove"); title = Res.get("shared.remove"); button.setId(null); + button.setStyle(CssTheme.isDarkTheme() ? "-fx-text-fill: white" : "-fx-text-fill: #444444"); button.setOnAction(e -> onRemoveOpenOffer(offer)); } else { boolean isSellOffer = offer.getDirection() == OfferPayload.Direction.SELL; iconView.setId(isSellOffer ? "image-buy-white" : "image-sell-white"); button.setId(isSellOffer ? "buy-button" : "sell-button"); + button.setStyle("-fx-text-fill: white"); if (isSellOffer) { title = CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ? Res.get("offerbook.takeOfferToBuy", offer.getOfferPayload().getBaseCurrencyCode()) : diff --git a/desktop/src/main/java/bisq/desktop/theme-dark.css b/desktop/src/main/java/bisq/desktop/theme-dark.css index eda7b4ed949..f2cde23af20 100644 --- a/desktop/src/main/java/bisq/desktop/theme-dark.css +++ b/desktop/src/main/java/bisq/desktop/theme-dark.css @@ -127,6 +127,7 @@ -bs-progress-bar-track: #272728; -bs-chart-tick: rgba(255, 255, 255, 0.7); -bs-chart-lines: rgba(0, 0, 0, 0.3); + -bs-white: white; } /* list view */ diff --git a/desktop/src/main/java/bisq/desktop/theme-light.css b/desktop/src/main/java/bisq/desktop/theme-light.css index a29c05630f3..751b56aa49f 100644 --- a/desktop/src/main/java/bisq/desktop/theme-light.css +++ b/desktop/src/main/java/bisq/desktop/theme-light.css @@ -100,4 +100,5 @@ -fx-selection-bar-non-focused: -fx-selection-bar; -fx-default-button: derive(-fx-accent, 95%); -bs-progress-bar-track: #e0e0e0; + -bs-white: white; } diff --git a/desktop/src/main/java/bisq/desktop/util/CssTheme.java b/desktop/src/main/java/bisq/desktop/util/CssTheme.java index 69d78b28223..7bfe6021272 100644 --- a/desktop/src/main/java/bisq/desktop/util/CssTheme.java +++ b/desktop/src/main/java/bisq/desktop/util/CssTheme.java @@ -23,10 +23,14 @@ public class CssTheme { public static final int CSS_THEME_LIGHT = 0; public static final int CSS_THEME_DARK = 1; + private static int currentCSSTheme; + public static void loadSceneStyles(Scene scene, int cssTheme) { String cssThemeFolder = "/bisq/desktop/"; String cssThemeFile = ""; + currentCSSTheme = cssTheme; + switch (cssTheme) { case CSS_THEME_DARK: @@ -40,13 +44,18 @@ public static void loadSceneStyles(Scene scene, int cssTheme) { } scene.getStylesheets().setAll( - // load base styles first - cssThemeFolder + "bisq.css", - cssThemeFolder + "images.css", - cssThemeFolder + "CandleStickChart.css", + // load base styles first + cssThemeFolder + "bisq.css", + cssThemeFolder + "images.css", + cssThemeFolder + "CandleStickChart.css", - // load theme last to allow override - cssThemeFolder + cssThemeFile + // load theme last to allow override + cssThemeFolder + cssThemeFile ); } + + public static boolean isDarkTheme() { + return currentCSSTheme == CSS_THEME_DARK; + } + }