mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
configurable default look and feel for mac
default is SystemLookAndFeel git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12373 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
committed by
wolf.posdorfer
parent
f2a7503d7c
commit
fbabf867de
@ -221,19 +221,30 @@ public final class Spark {
|
||||
}
|
||||
}
|
||||
|
||||
private String getLookandFeel(LocalPreferences preferences) {
|
||||
String result = "";
|
||||
|
||||
String whereToLook = isMac() ? Default.DEFAULT_LOOK_AND_FEEL_MAC
|
||||
: Default.DEFAULT_LOOK_AND_FEEL;
|
||||
|
||||
if (!Default.getBoolean("LOOK_AND_FEEL_DISABLED")) {
|
||||
result = preferences.getLookAndFeel();
|
||||
} else if (Default.getString(whereToLook).length() > 0) {
|
||||
result = Default.getString(whereToLook);
|
||||
} else {
|
||||
result = UIManager.getSystemLookAndFeelClassName();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the Loading of the Look And Feel
|
||||
*/
|
||||
private void loadLookAndFeel() {
|
||||
final LocalPreferences preferences = SettingsManager.getLocalPreferences();
|
||||
final String laf;
|
||||
if (!Default.getBoolean("LOOK_AND_FEEL_DISABLED")) {
|
||||
laf = preferences.getLookAndFeel();
|
||||
} else if (Default.getString(Default.DEFAULT_LOOK_AND_FEEL).length() > 0) {
|
||||
laf = Default.getString(Default.DEFAULT_LOOK_AND_FEEL);
|
||||
} else {
|
||||
laf = UIManager.getSystemLookAndFeelClassName();
|
||||
}
|
||||
final String laf = getLookandFeel(preferences);
|
||||
|
||||
try {
|
||||
if (laf.toLowerCase().contains("substance")) {
|
||||
|
||||
@ -62,6 +62,7 @@ public class Default {
|
||||
public static final String FRAME_IMAGE = "FRAME_IMAGE";
|
||||
public static final String LOOK_AND_FEEL_DISABLED = "LOOK_AND_FEEL_DISABLED";
|
||||
public static final String DEFAULT_LOOK_AND_FEEL = "DEFAULT_LOOK_AND_FEEL";
|
||||
public static final String DEFAULT_LOOK_AND_FEEL_MAC = "DEFAULT_LOOK_AND_FEEL_MAC";
|
||||
public static final String INSTALL_PLUGINS_DISABLED = "INSTALL_PLUGINS_DISABLED";
|
||||
public static final String DEINSTALL_PLUGINS_DISABLED = "DEINSTALL_PLUGINS_DISABLED";
|
||||
public static final String ADVANCED_DISABLED = "ADVANCED_DISABLED";
|
||||
|
||||
@ -124,6 +124,7 @@ CHANGE_COLORS_DISABLED =
|
||||
# Default Spark skin is com.jtattoo.plaf.luna.LunaLookAndFeel
|
||||
# other nice skin is org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel
|
||||
DEFAULT_LOOK_AND_FEEL = com.jtattoo.plaf.luna.LunaLookAndFeel
|
||||
DEFAULT_LOOK_AND_FEEL_MAC =
|
||||
# in JTatto Menubars can have Texts, default is empty
|
||||
MENUBAR_TEXT =
|
||||
|
||||
|
||||
Reference in New Issue
Block a user