diff --git a/core/src/main/java/bisq/core/locale/GlobalSettings.java b/core/src/main/java/bisq/core/locale/GlobalSettings.java index 2a4b25116ef..46856fd7a99 100644 --- a/core/src/main/java/bisq/core/locale/GlobalSettings.java +++ b/core/src/main/java/bisq/core/locale/GlobalSettings.java @@ -25,7 +25,6 @@ public class GlobalSettings { private static boolean useAnimations = true; - private static boolean useDarkMode = false; private static Locale locale; private static final ObjectProperty localeProperty = new SimpleObjectProperty<>(locale); private static TradeCurrency defaultTradeCurrency; @@ -48,10 +47,6 @@ public static void setUseAnimations(boolean useAnimations) { GlobalSettings.useAnimations = useAnimations; } - public static void setUseDarkMode(boolean useDarkMode) { - GlobalSettings.useDarkMode = useDarkMode; - } - public static void setDefaultTradeCurrency(TradeCurrency fiatCurrency) { GlobalSettings.defaultTradeCurrency = fiatCurrency; } diff --git a/desktop/src/main/java/bisq/desktop/bisq.css b/desktop/src/main/java/bisq/desktop/bisq.css index 82e8c86c5c9..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; + -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; + -fx-text-fill: -bs-white; } #sell-button-big:hover, #sell-button:hover, diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java index 31529db65f8..444889db984 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -156,7 +156,7 @@ public abstract class MutableOfferView> exten priceAsPercentageValueCurrencyBox, volumeValueCurrencyBox, priceValueCurrencyBox, minAmountValueCurrencyBox, advancedOptionsBox, paymentGroupBox; - private Subscription isWaitingForFundsSubscription, balanceSubscription, cancelButton2StyleSubscription; + private Subscription isWaitingForFundsSubscription, balanceSubscription; private ChangeListener amountFocusedListener, minAmountFocusedListener, volumeFocusedListener, buyerSecurityDepositFocusedListener, priceFocusedListener, placeOfferCompletedListener, priceAsPercentageFocusedListener, getShowWalletFundedNotificationListener, @@ -662,15 +662,11 @@ private void addSubscriptions() { waitingForFundsLabel.setManaged(isWaitingForFunds); }); - cancelButton2StyleSubscription = EasyBind.subscribe(placeOfferButton.visibleProperty(), - isVisible -> cancelButton2.setId(isVisible ? "cancel-button" : null)); - balanceSubscription = EasyBind.subscribe(model.getDataModel().getBalance(), balanceTextField::setBalance); } private void removeSubscriptions() { isWaitingForFundsSubscription.unsubscribe(); - cancelButton2StyleSubscription.unsubscribe(); balanceSubscription.unsubscribe(); } @@ -1294,7 +1290,7 @@ private void addAmountPriceFields() { Res.get("shared.distanceInPercent")); percentagePriceDescription = priceAsPercentageInputBoxTuple.first; - getSmallIconForLabel(MaterialDesignIcon.CHART_LINE, percentagePriceDescription); + getSmallIconForLabel(MaterialDesignIcon.CHART_LINE, percentagePriceDescription, "small-icon-label"); percentagePriceBox = priceAsPercentageInputBoxTuple.second; @@ -1367,7 +1363,7 @@ private void addSecondRow() { Tuple2 priceInputBoxTuple = getTradeInputBox(priceValueCurrencyBox, ""); priceDescriptionLabel = priceInputBoxTuple.first; - getSmallIconForLabel(MaterialDesignIcon.LOCK, priceDescriptionLabel); + getSmallIconForLabel(MaterialDesignIcon.LOCK, priceDescriptionLabel, "small-icon-label"); editOfferElements.add(priceDescriptionLabel); fixedPriceBox = priceInputBoxTuple.second; 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 4fdc386e200..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; @@ -1001,12 +1002,14 @@ public void updateItem(final OfferBookListItem newItem, boolean empty) { if (myOffer) { iconView.setId("image-remove"); title = Res.get("shared.remove"); - button.setId("cancel-button"); + 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/main/offer/takeoffer/TakeOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java index a59874b4493..324dc3ceb07 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java @@ -153,7 +153,7 @@ public class TakeOfferView extends ActivatableViewAndModel cancelButton2.setId(isVisible ? "cancel-button" : null)); } private void removeSubscriptions() { @@ -773,7 +771,6 @@ private void removeSubscriptions() { showTransactionPublishedScreenSubscription.unsubscribe(); // noSufficientFeeSubscription.unsubscribe(); balanceSubscription.unsubscribe(); - cancelButton2StyleSubscription.unsubscribe(); } private void addListeners() { @@ -1106,7 +1103,7 @@ private void addAmountPriceFields() { Res.get("takeOffer.amountPriceBox.priceDescription")); priceDescriptionLabel = priceInputBoxTuple.first; - getSmallIconForLabel(MaterialDesignIcon.LOCK, priceDescriptionLabel); + getSmallIconForLabel(MaterialDesignIcon.LOCK, priceDescriptionLabel, "small-icon-label"); VBox priceBox = priceInputBoxTuple.second; @@ -1145,7 +1142,7 @@ private void addSecondRow() { Res.get("shared.distanceInPercent")); priceAsPercentageDescription = priceAsPercentageInputBoxTuple.first; - getSmallIconForLabel(MaterialDesignIcon.CHART_LINE, priceAsPercentageDescription); + getSmallIconForLabel(MaterialDesignIcon.CHART_LINE, priceAsPercentageDescription, "small-icon-label"); priceAsPercentageInputBox = priceAsPercentageInputBoxTuple.second; diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java index e07b9515b9e..e3a87b9417c 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java @@ -385,7 +385,6 @@ private void addConfirmAndCancelButtons(boolean isPlaceOffer) { Button cancelButton = new AutoTooltipButton(Res.get("shared.cancel")); cancelButton.setDefaultButton(false); - cancelButton.setId("cancel-button"); cancelButton.setOnAction(e -> { closeHandlerOptional.ifPresent(Runnable::run); hide(); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferView.java index 9beaca27355..e769b6fab1e 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferView.java @@ -196,7 +196,6 @@ private void addConfirmEditGroup() { cancelButton = new AutoTooltipButton(Res.get("shared.cancel")); cancelButton.setDefaultButton(false); - cancelButton.setId("cancel-button"); cancelButton.setOnAction(event -> close()); editOfferConfirmationBox.getChildren().add(cancelButton); diff --git a/desktop/src/main/java/bisq/desktop/theme-dark.css b/desktop/src/main/java/bisq/desktop/theme-dark.css index 8306ff80cb7..f2cde23af20 100644 --- a/desktop/src/main/java/bisq/desktop/theme-dark.css +++ b/desktop/src/main/java/bisq/desktop/theme-dark.css @@ -107,11 +107,11 @@ -bs-toggle-selected: #25b135; -bs-warning: #db6300; - -bs-buy: #2ea33c; + -bs-buy: #006600; -bs-buy-focus: black; -bs-buy-hover: #237b2d; -bs-buy-transparent: rgba(46, 163, 60, 0.3); - -bs-sell: #ee6563; + -bs-sell: #660000; -bs-sell-focus: #090202; -bs-sell-hover: #b42522; -bs-sell-transparent: rgba(216, 52, 49, 0.3); @@ -125,6 +125,9 @@ -bs-green-soft: derive(-bs-rd-green, 60%); -bs-red-soft: derive(-bs-rd-error-red, 60%); -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 */ @@ -209,13 +212,6 @@ -fx-border-color: -bs-color-gray-2; } -#sell-button, #sell-button-big { - -fx-background-color: #660000 !important; -} -#buy-button, #buy-button-big { - -fx-background-color: #006600 !important; -} - .wallet-seed-words { -fx-text-fill: -bs-color-gray-6; } @@ -234,12 +230,12 @@ -fx-border-color: transparent transparent transparent transparent; } #charts .axis, #price-chart .axis, #volume-chart .axis, #charts-dao .axis { - -fx-tick-label-fill: rgba(255,255,255,0.7); + -fx-tick-label-fill: -bs-chart-tick; } .chart-horizontal-grid-lines, .chart-horizontal-zero-line, .chart-vertical-zero-line, .axis-tick-mark, .axis-minor-tick-mark { - -fx-stroke: rgba(0,0,0,0.3); + -fx-stroke: -bs-chart-lines; } /* scrollbars */ @@ -253,11 +249,17 @@ .scroll-bar:vertical .thumb:hover { -fx-background-color: -bs-color-gray-5; } + .scroll-bar:horizontal .thumb:pressed, .scroll-bar:vertical .thumb:pressed { -fx-background-color: -bs-color-gray-4; } + .scroll-bar:vertical:focused, .scroll-bar:horizontal:focused { -fx-background-color: transparent, -bs-color-gray-4, -bs-color-gray-4; } + +.small-icon-label { + -fx-fill: -bs-text-color; +} 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; + } + } diff --git a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java index cf4ed73b85a..7a0221ac43e 100644 --- a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java +++ b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java @@ -2045,10 +2045,13 @@ public static void removeRowsFromGridPane(GridPane gridPane, int fromGridRow, in // Icons /////////////////////////////////////////////////////////////////////////////////////////// - public static Text getIconForLabel(GlyphIcons icon, String iconSize, Label label) { + public static Text getIconForLabel(GlyphIcons icon, String iconSize, Label label, String style) { if (icon.fontFamily().equals(MATERIAL_DESIGN_ICONS)) { final Text textIcon = MaterialDesignIconFactory.get().createIcon(icon, iconSize); textIcon.setOpacity(0.7); + if (style != null) { + textIcon.getStyleClass().add(style); + } label.setContentDisplay(ContentDisplay.LEFT); label.setGraphic(textIcon); return textIcon; @@ -2057,6 +2060,14 @@ public static Text getIconForLabel(GlyphIcons icon, String iconSize, Label label } } + public static Text getIconForLabel(GlyphIcons icon, String iconSize, Label label) { + return getIconForLabel(icon, iconSize, label, null); + } + + public static Text getSmallIconForLabel(GlyphIcons icon, Label label, String style) { + return getIconForLabel(icon, "0.769em", label, style); + } + public static Text getSmallIconForLabel(GlyphIcons icon, Label label) { return getIconForLabel(icon, "0.769em", label); }