pivot-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gbr...@apache.org
Subject svn commit: r800882 - /incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
Date Tue, 04 Aug 2009 17:22:20 GMT
Author: gbrown
Date: Tue Aug  4 17:22:19 2009
New Revision: 800882

URL: http://svn.apache.org/viewvc?rev=800882&view=rev
Log:
Resolve issue PIVOT-196.

Modified:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java?rev=800882&r1=800881&r2=800882&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java Tue
Aug  4 17:22:19 2009
@@ -318,8 +318,7 @@
 
         if (content != null
             && (expander.isExpanded()
-                || (expandTransition != null
-                    && !expandTransition.isReversed()))) {
+                || expandTransition != null)) {
             // Title bar border is only drawn when content is non-null and
             // expander is expanded or expanding
             preferredHeight += 1;
@@ -360,8 +359,7 @@
                 preferredWidth);
 
             if (expander.isExpanded()
-                || (expandTransition != null
-                    && !expandTransition.isReversed())) {
+                || expandTransition != null) {
                 // Title bar border is only drawn when expander is expanded
                 // or expanding
                 preferredHeight += 1;
@@ -393,17 +391,17 @@
         titleBarTablePane.setSize(Math.max(width - 2, 0), titleBarHeight);
         titleBarTablePane.setLocation(1, 1);
 
-        if ((expander.isExpanded()
-            || (expandTransition != null
-                && !expandTransition.isReversed()))
-            && content != null) {
-            int contentWidth = Math.max(width - (2 + padding.left + padding.right), 0);
-            int contentHeight = Math.max(height - (3 + padding.top + padding.bottom + titleBarHeight),
0);
-            content.setSize(contentWidth, contentHeight);
-
-            int contentX = 1 + padding.left;
-            int contentY = 2 + padding.top + titleBarHeight;
-            content.setLocation(contentX, contentY);
+        if (expander.isExpanded()
+            || expandTransition != null) {
+            if (content != null) {
+                int contentWidth = Math.max(width - (2 + padding.left + padding.right), 0);
+                int contentHeight = Math.max(height - (3 + padding.top + padding.bottom +
titleBarHeight), 0);
+                content.setSize(contentWidth, contentHeight);
+
+                int contentX = 1 + padding.left;
+                int contentY = 2 + padding.top + titleBarHeight;
+                content.setLocation(contentX, contentY);
+            }
         }
     }
 
@@ -414,20 +412,14 @@
         int width = getWidth();
         int height = getHeight();
 
-        Expander expander = (Expander)getComponent();
-        if (expander.isExpanded()
-            || (expandTransition != null
-                && !expandTransition.isReversed())) {
-            int titleBarHeight = titleBarTablePane.getPreferredHeight(-1);
-            graphics.setPaint(titleBarBorderColor);
-            GraphicsUtilities.drawLine(graphics, 0, 1 + titleBarHeight, width, Orientation.HORIZONTAL);
-        }
-
         int titleBarX = titleBarTablePane.getX();
         int titleBarY = titleBarTablePane.getY();
         int titleBarWidth = titleBarTablePane.getWidth();
         int titleBarHeight = titleBarTablePane.getHeight();
 
+        graphics.setPaint(titleBarBorderColor);
+        GraphicsUtilities.drawLine(graphics, 0, 1 + titleBarHeight, width, Orientation.HORIZONTAL);
+
         graphics.setPaint(new GradientPaint(titleBarX + titleBarWidth / 2, titleBarY, titleBarBevelColor,
             titleBarX + titleBarWidth / 2, titleBarY + titleBarHeight, titleBarBackgroundColor));
         graphics.fillRect(titleBarX, titleBarY, titleBarWidth, titleBarHeight);



Mime
View raw message