mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- ComboBox style now set globally via UIManager which should hopefully resolve issue with Mac (see http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=11126#p125845).
This commit is contained in:
@@ -172,6 +172,7 @@ public enum FControl {
|
||||
UIManager.put("TabbedPane.selected", FSkin.getColor(FSkin.Colors.CLR_ACTIVE));
|
||||
UIManager.put("TabbedPane.contentOpaque", FSkin.getColor(FSkin.Colors.CLR_THEME));
|
||||
UIManager.put("TabbedPane.unselectedBackground", FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
setComboBoxLookAndFeel();
|
||||
|
||||
this.shortcuts = KeyboardShortcuts.attachKeyboardShortcuts();
|
||||
this.display = FView.SINGLETON_INSTANCE.getLpnDocument();
|
||||
@@ -207,6 +208,22 @@ public enum FControl {
|
||||
public void run() { Singletons.getView().initialize(); } });
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/">UIManager Defaults</a>
|
||||
*/
|
||||
private void setComboBoxLookAndFeel() {
|
||||
if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_THEMED_COMBOBOX)) {
|
||||
UIManager.put("ComboBox.background", FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
UIManager.put("ComboBox.foreground", FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||
UIManager.put("ComboBox.selectionBackground", FSkin.getColor(FSkin.Colors.CLR_ACTIVE));
|
||||
UIManager.put("ComboBox.selectionForeground", FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||
UIManager.put("ComboBox.disabledBackground", FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
UIManager.put("ComboBox.disabledForeground", FSkin.getColor(FSkin.Colors.CLR_THEME2).darker());
|
||||
UIManager.put("Button.select", FSkin.getColor(FSkin.Colors.CLR_ACTIVE));
|
||||
UIManager.put("ComboBox.font", FSkin.getFont(UIManager.getFont("ComboBox.font").getSize()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches between display states in top level JFrame.
|
||||
*/
|
||||
|
||||
@@ -96,8 +96,6 @@ public class FComboBoxPanel<E> extends JPanel {
|
||||
lst0, val0, i0, isSelected, cellHasFocus);
|
||||
|
||||
lblItem.setBorder(new EmptyBorder(4, 3, 4, 3));
|
||||
lblItem.setBackground(FSkin.getColor(hasFocus() ? FSkin.Colors.CLR_ACTIVE : FSkin.Colors.CLR_INACTIVE));
|
||||
lblItem.setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||
lblItem.setFont(FSkin.getFont(12));
|
||||
lblItem.setOpaque(isSelected);
|
||||
return lblItem;
|
||||
|
||||
Reference in New Issue
Block a user