Viewing Issue Advanced Details

ID 0003128 Category [DMDirc] User Interface Severity minor
Reproducibility always Date Submitted 2009-11-13 14:30 Last Update 2010-03-06 21:33
Reporter Error Reporter Assigned To Greboid View Status public
Priority normal Status closed Resolution fixed
Platform Fixed in Version Target Version 0.6.3
Product Version Product Build
Summary 0003128: when using swing + native GTK look, the preferences dialog will have many entries that look normal but many will also ignore the
Description
when using swing + native GTK look, the preferences dialog will have many entries that look normal but many will also ignore the GTK text colour and default to black which makes many things hard to read with a dark GTK style (using sun's java)
Needs unit test no
Upstream Bug URL

Relationships

Notes

(0008029)
Anonymous (reporter)
2009-11-13 14:57

http://eloxoph.com/archive/dmd0.6.3m2gtkissue.png [^]
(0008030)
Dataforce (administrator)
2009-11-13 14:59

Also maybe worth noting that the user is on KDE not Gnome
authorGregory Holmes <greg@dmdirc.com>2009-11-20 23:12:48 (GMT)
committer Gregory Holmes <greboid@dmdirc.com>2009-11-20 23:28:46 (GMT)
commit960203f8163a821561605bf258d03f975e31c037 (patch) (side-by-side diff)
Change-Id: I1a299eb7fd17d00944747fcc765a52da162f0f24 Reviewed-on: http://gerrit.dmdirc.com/74 Reviewed-by: Shane Mc Cormack <shane@dmdirc.com> Tested-by: Gregory Holmes <greboid@dmdirc.com>
-rw-r--r--src/com/dmdirc/addons/ui_swing/components/text/TextLabel.java14
-rw-r--r--src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryLabel.java6
2 files changed, 14 insertions, 6 deletions
Click to Expand/Collapse
diff src/com/dmdirc/addons/ui_swing/components/text/TextLabel.java
@@ -22,6 +22,7 @@
package com.dmdirc.addons.ui_swing.components.text;
+import java.awt.Color;
import java.awt.Font;
import java.awt.Insets;
@@ -34,6 +35,7 @@ import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;
+import javax.swing.text.html.StyleSheet;
/**
* Dyamnic text label.
@@ -76,11 +78,15 @@ public class TextLabel extends JTextPane {
setEditorKit(new HTMLEditorKit());
setUI(new BasicTextPaneUI());
+ final StyleSheet styleSheet = ((HTMLDocument) getDocument()).getStyleSheet();
final Font font = UIManager.getFont("Label.font");
- ((HTMLDocument) getDocument()).getStyleSheet().addRule("body " +
- "{ font-family: " + font.getFamily() + "; " + "font-size: " +
- font.getSize() + "pt; }");
- ((HTMLDocument) getDocument()).getStyleSheet().addRule("p { margin: 0; }");
+ final Color colour = UIManager.getColor("Label.foreground");
+ styleSheet.addRule("body "
+ + "{ font-family: " + font.getFamily() + "; "
+ + "font-size: " + font.getSize() + "pt; }");
+ styleSheet.addRule("p { margin: 0; }");
+ styleSheet.addRule("* { color: rgb(" + colour.getRed()
+ + ", " + colour.getGreen() + ", " + colour.getBlue()+"); }");
setOpaque(false);
setEditable(false);
Click to Expand/Collapse
diff src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryLabel.java
@@ -35,6 +35,7 @@ import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.SwingWorker;
+import javax.swing.UIManager;
import net.miginfocom.layout.PlatformDefaults;
/**
@@ -99,10 +100,11 @@ public class CategoryLabel extends JLabel {
hasChildren = hasChildren || index + 1 == numCats;
- setBackground(Color.LIGHT_GRAY);
+ setBackground(UIManager.getColor("ToolTip.background"));
+ setForeground(UIManager.getColor("ToolTip.foreground"));
setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(1, 0, hasChildren ? 1 : 0, 0,
- Color.GRAY),
+ UIManager.getColor("ToolTip.background").darker().darker()),
getBorder()));
}
}

Issue History

Date Modified Username Field Change
2009-11-13 14:30 Error Reporter New Issue
2009-11-13 14:57 Anonymous Note Added: 0008029
2009-11-13 14:58 Dataforce Needs unit test => no
2009-11-13 14:58 Dataforce Assigned To => Greboid
2009-11-13 14:58 Dataforce Status new => assigned
2009-11-13 14:59 Dataforce Note Added: 0008030
2009-11-20 23:29 Greboid Checkin
2009-11-20 23:29 Greboid Note Added: 0008063
2009-11-20 23:29 Greboid Status assigned => resolved
2009-11-20 23:29 Greboid Resolution open => fixed
2009-11-21 22:49 MD87 Category *Unsorted => User Interface
2010-03-06 21:33 Greboid Status resolved => closed