Skip to content

Commit

Permalink
Add back manual style workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
ripcurlx committed Jan 8, 2020
1 parent ce1e954 commit 3a395bc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
8 changes: 4 additions & 4 deletions desktop/src/main/java/bisq/desktop/bisq.css
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()) :
Expand Down
1 change: 1 addition & 0 deletions desktop/src/main/java/bisq/desktop/theme-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions desktop/src/main/java/bisq/desktop/theme-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
21 changes: 15 additions & 6 deletions desktop/src/main/java/bisq/desktop/util/CssTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
}

}

0 comments on commit 3a395bc

Please sign in to comment.