classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: MetalComboBoxIcon


From: David Gilbert
Subject: [cp-patches] FYI: MetalComboBoxIcon
Date: Wed, 14 Sep 2005 08:21:08 +0000
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050728)

I committed this small change to update the icon color depending on the 
component state:

2005-09-14  David Gilbert  <address@hidden>

        * javax/swing/plaf/metal/MetalComboBoxIcon.java: fixed header,
        (paintIcon): change color to reflect component state.

Regards,

Dave
Index: javax/swing/plaf/metal/MetalComboBoxIcon.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java,v
retrieving revision 1.1
diff -u -r1.1 MetalComboBoxIcon.java
--- javax/swing/plaf/metal/MetalComboBoxIcon.java       15 Jul 2005 16:27:10 
-0000      1.1
+++ javax/swing/plaf/metal/MetalComboBoxIcon.java       14 Sep 2005 07:16:15 
-0000
@@ -1,4 +1,4 @@
-/* MetalComboBoxButton.java
+/* MetalComboBoxIcon.java
    Copyright (C) 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
@@ -88,10 +88,11 @@
    */
   public void paintIcon(Component c, Graphics g, int x, int y)
   {
-    // TODO: work out whether/how the icon changes with different component
-    //       states (and also different metal themes)
     Color savedColor = g.getColor();
-    g.setColor(Color.black);
+    if (c.isEnabled())
+      g.setColor(MetalLookAndFeel.getBlack());
+    else
+      g.setColor(MetalLookAndFeel.getControlDisabled());
     for (int i = 0; i < 5; i++)
       g.drawLine(x + i, y + i, x + 9 - i, y + i);
     g.setColor(savedColor);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]