SPARK-1258, SPARK-1257

updates to default.properties customization of colors
added new preference panel Color

Color-Panel and Appearance Panel are now tabbed

ill post a guide on how to configure the default.properties in the forum

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12185 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Wolf Posdorfer
2011-03-25 15:29:00 +00:00
committed by wolf.posdorfer
parent 11eb9afd28
commit 8331b41590
15 changed files with 737 additions and 86 deletions

View File

@ -39,6 +39,8 @@ import javax.swing.UIDefaults;
import javax.swing.UIManager;
import org.jivesoftware.resource.Default;
import org.jivesoftware.spark.ui.themes.ColorSettingManager;
import org.jivesoftware.spark.ui.themes.ColorSettings;
import org.jivesoftware.spark.util.ModelUtil;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
@ -381,10 +383,6 @@ public final class Spark {
if (isLinux()) {
return ".Spark";
}
/*else if (isWindows()) {
return "Spark";
} (not needed really)*/
return "Spark";
}
@ -426,47 +424,53 @@ public final class Spark {
*/
public static void installBaseUIProperties() {
setApplicationFont(new Font("Dialog", Font.PLAIN, 11));
UIManager.put("TextField.lightforeground", Color.gray);
UIManager.put("TextField.foreground", Color.BLACK);
UIManager.put("TextField.caretForeground", Color.black);
//UIManager.put("TextField.font", new Font("Dialog", Font.PLAIN, 11));
UIManager.put("List.selectionBackground", new Color(217, 232, 250));
UIManager.put("List.selectionForeground", Color.black);
UIManager.put("List.selectionBorder", new Color(187, 195, 215));
UIManager.put("List.foreground", Color.black);
UIManager.put("List.background", Color.white);
UIManager.put("MenuItem.selectionBackground", new Color(217, 232, 250));
UIManager.put("MenuItem.selectionForeground", Color.black);
UIManager.put("TextPane.foreground", Color.black);
UIManager.put("TextPane.background", Color.white);
UIManager.put("TextPane.inactiveForeground", Color.white);
UIManager.put("TextPane.caretForeground", Color.black);
UIManager.put("ChatInput.SelectedTextColor", Color.white);
UIManager.put("ChatInput.SelectionColor", new Color(209, 223, 242));
UIManager.put("ContactItemNickname.foreground", Color.black);
UIManager.put("ContactItemDescription.foreground", Color.gray);
UIManager.put("ContactItem.background", new Color(240, 243, 253));
UIManager.put("ContactItem.border", BorderFactory.createLineBorder(Color.white));
UIManager.put("ContactItemOffline.color", Color.gray);
UIManager.put("Table.foreground", Color.black);
UIManager.put("Table.background", Color.white);
//UIManager.put("TextField.font", new Font("Dialog", Font.PLAIN, 11));
//UIManager.put("Label.font", new Font("Dialog", Font.PLAIN, 11));
// Chat Area Text Settings
UIManager.put("Link.foreground", Color.blue);
UIManager.put("Address.foreground", new Color(212, 160, 0));
UIManager.put("User.foreground", Color.blue);
UIManager.put("OtherUser.foreground", Color.red);
UIManager.put("Notification.foreground", new Color(0, 128, 0));
UIManager.put("Error.foreground", Color.red);
UIManager.put("Question.foreground", Color.red);
UIManager.put("History.foreground", Color.darkGray);
UIManager.put("SparkTabbedPane.startColor", new Color(236, 236, 236));
UIManager.put("SparkTabbedPane.endColor", new Color(236, 236, 236));
UIManager.put("SparkTabbedPane.borderColor", Color.lightGray);
ColorSettings colorsettings = ColorSettingManager.getColorSettings();
for(String property : colorsettings.getKeys())
{
Color c = colorsettings.getColorFromProperty(property);
UIManager.put(property, c);
}
// UIManager.put("TextField.lightforeground", Color.gray);
// UIManager.put("TextField.foreground", Color.BLACK);
// UIManager.put("TextField.caretForeground", Color.black);
// UIManager.put("List.selectionBackground", new Color(217, 232, 250));
// UIManager.put("List.selectionForeground", Color.black);
// UIManager.put("List.selectionBorder", new Color(187, 195, 215));
// UIManager.put("List.foreground", Color.black);
// UIManager.put("List.background", Color.white);
// UIManager.put("MenuItem.selectionBackground", new Color(217, 232, 250));
// UIManager.put("MenuItem.selectionForeground", Color.black);
// UIManager.put("TextPane.foreground", Color.black);
// UIManager.put("TextPane.background", new Color(255,255,255,0));
// UIManager.put("TextPane.inactiveForeground", Color.white);
// UIManager.put("TextPane.caretForeground", Color.black);
// UIManager.put("ChatInput.SelectedTextColor", Color.white);
// UIManager.put("ChatInput.SelectionColor", Color.blue);
// UIManager.put("ContactItemNickname.foreground", Color.black);
// UIManager.put("ContactItemDescription.foreground", Color.gray);
// UIManager.put("ContactItem.background", new Color(240, 243, 253,0));
// UIManager.put("ContactItemOffline.color", Color.gray);
// UIManager.put("Table.foreground", Color.black);
// UIManager.put("Table.background", Color.white);
// // Chat Area Text Settings
// UIManager.put("Link.foreground", Color.blue);
// UIManager.put("Address.foreground", new Color(212, 160, 0));
// UIManager.put("User.foreground", Color.blue);
// UIManager.put("OtherUser.foreground", Color.red);
// UIManager.put("Notification.foreground", new Color(0, 128, 0));
// UIManager.put("Error.foreground", Color.red);
// UIManager.put("Question.foreground", Color.red);
// UIManager.put("History.foreground", Color.darkGray);
// UIManager.put("SparkTabbedPane.startColor", new Color(236, 236, 236));
// UIManager.put("SparkTabbedPane.endColor", new Color(236, 236, 236));
// UIManager.put("SparkTabbedPane.borderColor", Color.lightGray);
}
/**