You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/08/04 19:22:20 UTC

svn commit: r800882 - /incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java

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);