Skip to content

Commit

Permalink
GUI, deck editor: improved toolbar icons in dark themes (#12873, #12920)
Browse files Browse the repository at this point in the history
Co-authored-by: TandEm <[email protected]>
  • Loading branch information
T-a-n-d-E-m and TandEm authored Sep 28, 2024
1 parent 85e4d4d commit 571eb69
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Mage.Client/src/main/java/mage/client/cards/CardsList.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void makeTransparent() {
panelCardArea.setOpaque(false);
cardArea.setOpaque(false);
panelCardArea.getViewport().setOpaque(false);
panelControl.setBackground(new Color(250, 250, 250, 150));
panelControl.setBackground(PreferencesDialog.getCurrentTheme().getDeckEditorToolbarBackgroundColor());
panelControl.setOpaque(true);
cbSortBy.setModel(new DefaultComboBoxModel<>(SortBy.values()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ public void mouseDragged(MouseEvent e) {

JPanel toolbar = new JPanel(new BorderLayout());
JPanel toolbarInner = new JPanel();
toolbar.setBackground(new Color(250, 250, 250, 150));
toolbar.setBackground(PreferencesDialog.getCurrentTheme().getDeckEditorToolbarBackgroundColor());
toolbar.setOpaque(true);
toolbarInner.setOpaque(false);
toolbarInner.add(deckNameAndCountLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import mage.client.MageFrame;
import mage.client.cards.*;
import mage.client.constants.Constants.SortBy;
import mage.client.dialog.PreferencesDialog;
import mage.client.deckeditor.table.TableModel;
import mage.client.dialog.CheckBoxList;
import mage.client.util.GUISizeHelper;
Expand Down Expand Up @@ -97,11 +98,11 @@ private void makeTransparent() {
jTextFieldSearch.addActionListener(searchAction);

// make the components more readable
tbColor.setBackground(new Color(250, 250, 250, 150));
tbColor.setBackground(PreferencesDialog.getCurrentTheme().getDeckEditorToolbarBackgroundColor());
tbColor.setOpaque(true); // false = transparent
tbTypes.setBackground(new Color(250, 250, 250, 150));
tbTypes.setBackground(PreferencesDialog.getCurrentTheme().getDeckEditorToolbarBackgroundColor());
tbTypes.setOpaque(true); // false = transparent
cardSelectorBottomPanel.setBackground(new Color(250, 250, 250, 150));
cardSelectorBottomPanel.setBackground(PreferencesDialog.getCurrentTheme().getDeckEditorToolbarBackgroundColor());
cardSelectorBottomPanel.setOpaque(true); // false = transparent
}

Expand Down
78 changes: 45 additions & 33 deletions Mage.Client/src/main/java/mage/client/themes/ThemeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@
*/
public enum ThemeType {
// https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html
DEFAULT("Default",
"",
true,
false,
true,
true,
true,
true,
true,
new Color(169, 176, 190), // nimbusBlueGrey
new Color(214, 217, 223), // control
new Color(255, 255, 255), // nimbusLightBackground
new Color(242, 242, 189), // info
new Color(51, 98, 140), // nimbusBase
null, // mageToolbar
DEFAULT("Default", // name
"", // path
true, // hasBackground
false, // hasLoginBackground
true, // hasBattleBackground
true, // hasSkipButtons
true, // hasPhaseIcons
true, // hasWinLossImages
true, // shortcutsVisibleForSkipButtons
new Color(169, 176, 190), // nimbusBlueGrey
new Color(214, 217, 223), // control
new Color(255, 255, 255), // nimbusLightBackground
new Color(242, 242, 189), // info
new Color(51, 98, 140), // nimbusBase
null, // mageToolbar
new Color(200, 200, 180, 200), // playerPanel_inactiveBackgroundColor
new Color(200, 255, 200, 200), // playerPanel_activeBackgroundColor
new Color(131, 94, 83, 200), // playerPanel_deadBackgroundColor
// card icons
new Color(169, 176, 190),
Color.black,
new Color(51, 98, 140),
Color.black
new Color(131, 94, 83, 200), // playerPanel_deadBackgroundColor
new Color(250, 250, 250, 150), // deckEditorToolbarBackgroundColor
new Color(169, 176, 190), // cardIconsFillColor
Color.black, // cardIconsStrokeColor
new Color(51, 98, 140), // cardIconsTextColor
Color.black // textColor
),
GREY("Grey",
"grey-theme/",
Expand All @@ -55,6 +55,7 @@ public enum ThemeType {
new Color(172, 172, 172, 200), // playerPanel_inactiveBackgroundColor
new Color(180, 234, 180, 200), // playerPanel_activeBackgroundColor
new Color(99, 99, 99, 200), // playerPanel_deadBackgroundColor
new Color(250, 250, 250, 150), // deckEditorToolbarBackgroundColor
// card icons
new Color(158, 158, 158),
Color.black,
Expand All @@ -79,6 +80,7 @@ public enum ThemeType {
new Color(243, 233, 164), // playerPanel_inactiveBackgroundColor
new Color(204, 236, 201), // playerPanel_activeBackgroundColor
new Color(106, 0, 255), // playerPanel_deadBackgroundColor
new Color(250, 250, 250, 150), // deckEditorToolbarBackgroundColor
// card icons
new Color(246, 136, 158),
Color.black,
Expand All @@ -103,6 +105,7 @@ public enum ThemeType {
new Color(219, 193, 172), // playerPanel_inactiveBackgroundColor
new Color(204, 236, 201), // playerPanel_activeBackgroundColor
new Color(99, 72, 50, 255), // playerPanel_deadBackgroundColor
new Color(250, 250, 250, 150), // deckEditorToolbarBackgroundColor
// card icons
new Color(219, 193, 172),
Color.black,
Expand All @@ -127,6 +130,7 @@ public enum ThemeType {
new Color(172, 195, 219), // playerPanel_inactiveBackgroundColor
new Color(204, 236, 201), // playerPanel_activeBackgroundColor
new Color(50, 68, 99, 255), // playerPanel_deadBackgroundColor
new Color(250, 250, 250, 150), // deckEditorToolbarBackgroundColor
// card icons
new Color(172, 197, 219),
Color.black,
Expand All @@ -142,19 +146,20 @@ public enum ThemeType {
true,
true,
true,
new Color(43, 45, 49), // buttons, scrollar background, disabled inputs
new Color(49, 51, 56), // window background
new Color(58, 56, 64), // inputs, table rows
new Color(58, 56, 64), // tooltips
new Color(25, 25, 25), // title bars, scrollbar foreground
new Color(43, 45, 49), // mageToolbar
new Color(43, 45, 49), // playerPanel_inactiveBackgroundColor
new Color(64, 61, 56), // playerPanel_activeBackgroundColor
new Color(43, 45, 49), // buttons, scrollar background, disabled inputs
new Color(49, 51, 56), // window background
new Color(58, 56, 64), // inputs, table rows
new Color(58, 56, 64), // tooltips
new Color(25, 25, 25), // title bars, scrollbar foreground
new Color(43, 45, 49), // mageToolbar
new Color(43, 45, 49), // playerPanel_inactiveBackgroundColor
new Color(64, 61, 56), // playerPanel_activeBackgroundColor
new Color(50, 68, 99, 255), // playerPanel_deadBackgroundColor
new Color(172, 197, 219),
Color.BLACK,
new Color(0, 78, 97),
new Color(220, 220, 220)
new Color(50, 50, 50, 250), // deckEditorToolbarBackgroundColor
new Color(172, 197, 219), // cardIconsFillColor
Color.BLACK, // cardIconsStrokeColor
new Color(0, 78, 97), // cardIconsTextColor
new Color(220, 220, 220) // textColor
);

private final String name;
Expand All @@ -175,6 +180,7 @@ public enum ThemeType {
private final Color playerPanel_inactiveBackgroundColor;
private final Color playerPanel_activeBackgroundColor;
private final Color playerPanel_deadBackgroundColor;
private final Color deckEditorToolbarBackgroundColor;
// card icons settings (example: flying icon)
private final Color cardIconsFillColor;
private final Color cardIconsStrokeColor;
Expand All @@ -201,6 +207,7 @@ public enum ThemeType {
Color playerPanel_inactiveBackgroundColor,
Color playerPanel_activeBackgroundColor,
Color playerPanel_deadBackgroundColor,
Color deckEditorToolbarBackgroundColor,
Color cardIconsFillColor,
Color cardIconsStrokeColor,
Color cardIconsTextColor,
Expand All @@ -224,6 +231,7 @@ public enum ThemeType {
this.playerPanel_activeBackgroundColor = playerPanel_activeBackgroundColor;
this.playerPanel_deadBackgroundColor = playerPanel_deadBackgroundColor;
this.playerPanel_inactiveBackgroundColor = playerPanel_inactiveBackgroundColor;
this.deckEditorToolbarBackgroundColor = deckEditorToolbarBackgroundColor;
this.cardIconsFillColor = cardIconsFillColor;
this.cardIconsStrokeColor = cardIconsStrokeColor;
this.cardIconsTextColor = cardIconsTextColor;
Expand Down Expand Up @@ -292,6 +300,10 @@ public Color getPlayerPanel_deadBackgroundColor() {
return playerPanel_deadBackgroundColor;
}

public Color getDeckEditorToolbarBackgroundColor() {
return deckEditorToolbarBackgroundColor;
}

private String getImagePath(String imageType, String name) {
return "/" + imageType + "/" + path + name;
}
Expand Down

0 comments on commit 571eb69

Please sign in to comment.