You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2013/10/29 18:56:09 UTC

svn commit: r1536833 - /pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java

Author: rwhitcomb
Date: Tue Oct 29 17:56:09 2013
New Revision: 1536833

URL: http://svn.apache.org/r1536833
Log:
PIVOT-925: Fix Expander's title bar color, which is only effective for the first
time the control is expanded/contracted after being set.

I added a field to store the color and changed the method that sets the color
during expansion/contraction to just set the label color from either the saved
color or the inactive color depending on the state.

Modified:
    pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java

Modified: pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java?rev=1536833&r1=1536832&r2=1536833&view=diff
==============================================================================
--- pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java (original)
+++ pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java Tue Oct 29 17:56:09 2013
@@ -200,6 +200,7 @@ public class TerraExpanderSkin extends E
 
     private Color titleBarBackgroundColor;
     private Color titleBarBorderColor;
+    private Color titleBarColor;
     private Color shadeButtonColor;
     private Color disabledShadeButtonColor;
     private Color borderColor;
@@ -240,6 +241,7 @@ public class TerraExpanderSkin extends E
 
         titleBarBackgroundColor = theme.getColor(10);
         titleBarBorderColor = theme.getColor(7);
+        titleBarColor = theme.getColor(12);
         shadeButtonColor = theme.getColor(12);
         disabledShadeButtonColor = theme.getColor(7);
         borderColor = theme.getColor(7);
@@ -269,7 +271,7 @@ public class TerraExpanderSkin extends E
         titleRow.add(titleBoxPane);
         titleRow.add(buttonBoxPane);
 
-        titleLabel.getStyles().put("color", shadeButtonColor);
+        titleLabel.getStyles().put("color", titleBarColor);
 
         Font titleFont = theme.getFont().deriveFont(Font.BOLD);
         titleLabel.getStyles().put("font", titleFont);
@@ -495,10 +497,11 @@ public class TerraExpanderSkin extends E
     }
 
     public Color getTitleBarColor() {
-        return (Color)titleLabel.getStyles().get("color");
+        return this.titleBarColor;
     }
 
     public void setTitleBarColor(Color titleBarColor) {
+        this.titleBarColor = titleBarColor;
         titleLabel.getStyles().put("color", titleBarColor);
     }
 
@@ -661,9 +664,9 @@ public class TerraExpanderSkin extends E
     @Override
     public void enabledChanged(Component component) {
         if (component.isEnabled()) {
-            setTitleBarColor(shadeButtonColor);
+            titleLabel.getStyles().put("color", titleBarColor);
         } else {
-            setTitleBarColor(disabledShadeButtonColor);
+            titleLabel.getStyles().put("color", disabledShadeButtonColor);
         }
     }