From 8b38feef91802d4bf0d237c04bfbc30fe731dfff Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 8 Jan 2020 17:26:56 +0100 Subject: [PATCH 1/6] Force the text-fill style to fix wrong text color every now and then --- desktop/src/main/java/bisq/desktop/bisq.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/bisq.css b/desktop/src/main/java/bisq/desktop/bisq.css index 82e8c86c5c..eb7ba927c9 100644 --- a/desktop/src/main/java/bisq/desktop/bisq.css +++ b/desktop/src/main/java/bisq/desktop/bisq.css @@ -1650,7 +1650,7 @@ textfield */ #buy-button { -fx-background-color: -bs-buy; - -fx-text-fill: white; + -fx-text-fill: white !important; } #buy-button-big:hover, #buy-button:hover, @@ -1666,7 +1666,7 @@ textfield */ #sell-button { -fx-background-color: -bs-sell; - -fx-text-fill: white; + -fx-text-fill: white !important; } #sell-button-big:hover, #sell-button:hover, From 34dc386cb5f6978402d909401ca21c442511e99e Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 8 Jan 2020 17:27:25 +0100 Subject: [PATCH 2/6] Update buy and sell color and move all color codes to the top --- .../src/main/java/bisq/desktop/theme-dark.css | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/theme-dark.css b/desktop/src/main/java/bisq/desktop/theme-dark.css index 8306ff80cb..b0b23966b8 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,8 @@ -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); } /* list view */ @@ -209,13 +211,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 +229,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 */ From 10cf4bb0206760b8442ba299f0e223b6327e9a60 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 8 Jan 2020 18:00:59 +0100 Subject: [PATCH 3/6] The small icon on top should match the label color --- .../bisq/desktop/main/offer/MutableOfferView.java | 4 ++-- .../desktop/main/offer/takeoffer/TakeOfferView.java | 4 ++-- desktop/src/main/java/bisq/desktop/theme-dark.css | 6 ++++++ .../main/java/bisq/desktop/util/FormBuilder.java | 13 ++++++++++++- 4 files changed, 22 insertions(+), 5 deletions(-) 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 31529db65f..648811ab52 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -1294,7 +1294,7 @@ public abstract class MutableOfferView> exten 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 +1367,7 @@ public abstract class MutableOfferView> exten 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/takeoffer/TakeOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java index a59874b449..9ce0645267 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 @@ -1106,7 +1106,7 @@ public class TakeOfferView extends ActivatableViewAndModel Date: Wed, 8 Jan 2020 18:18:04 +0100 Subject: [PATCH 4/6] Remove non existing id style "cancel-button" --- .../main/java/bisq/desktop/main/offer/MutableOfferView.java | 6 +----- .../bisq/desktop/main/offer/offerbook/OfferBookView.java | 2 +- .../bisq/desktop/main/offer/takeoffer/TakeOfferView.java | 5 +---- .../desktop/main/overlays/windows/OfferDetailsWindow.java | 1 - .../desktop/main/portfolio/editoffer/EditOfferView.java | 1 - 5 files changed, 3 insertions(+), 12 deletions(-) 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 648811ab52..444889db98 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 @@ public abstract class MutableOfferView> exten 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(); } 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 4fdc386e20..c0b3141d49 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 @@ -1001,7 +1001,7 @@ public class OfferBookView extends ActivatableViewAndModel onRemoveOpenOffer(offer)); } else { boolean isSellOffer = offer.getDirection() == OfferPayload.Direction.SELL; 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 9ce0645267..324dc3ceb0 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 @@ public class TakeOfferView extends ActivatableViewAndModel { 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 9beaca2735..e769b6fab1 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 @@ public class EditOfferView extends MutableOfferView { cancelButton = new AutoTooltipButton(Res.get("shared.cancel")); cancelButton.setDefaultButton(false); - cancelButton.setId("cancel-button"); cancelButton.setOnAction(event -> close()); editOfferConfirmationBox.getChildren().add(cancelButton); From ce1e954236d73e3ae3fbfbcfc416d8c1161e8615 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 8 Jan 2020 21:23:02 +0100 Subject: [PATCH 5/6] Remove dead code --- core/src/main/java/bisq/core/locale/GlobalSettings.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/src/main/java/bisq/core/locale/GlobalSettings.java b/core/src/main/java/bisq/core/locale/GlobalSettings.java index 2a4b25116e..46856fd7a9 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 @@ import java.util.Locale; 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 class GlobalSettings { GlobalSettings.useAnimations = useAnimations; } - public static void setUseDarkMode(boolean useDarkMode) { - GlobalSettings.useDarkMode = useDarkMode; - } - public static void setDefaultTradeCurrency(TradeCurrency fiatCurrency) { GlobalSettings.defaultTradeCurrency = fiatCurrency; } From 3a395bca4e2395b54dfb04f9af75d757a00a3614 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 8 Jan 2020 21:24:21 +0100 Subject: [PATCH 6/6] Add back manual style workaround --- desktop/src/main/java/bisq/desktop/bisq.css | 8 +++---- .../main/offer/offerbook/OfferBookView.java | 3 +++ .../src/main/java/bisq/desktop/theme-dark.css | 1 + .../main/java/bisq/desktop/theme-light.css | 1 + .../main/java/bisq/desktop/util/CssTheme.java | 21 +++++++++++++------ 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/bisq.css b/desktop/src/main/java/bisq/desktop/bisq.css index eb7ba927c9..24f389dd53 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 c0b3141d49..8f0ff34636 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.funds.withdrawal.WithdrawalView; 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 class OfferBookView extends ActivatableViewAndModel 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 eda7b4ed94..f2cde23af2 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 a29c05630f..751b56aa49 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 69d78b2822..7bfe602127 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 class 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; + } + }