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 2010/09/17 17:56:21 UTC

svn commit: r998181 - in /pivot/trunk/wtk/src/org/apache/pivot/wtk/skin: CalendarButtonSkin.java ColorChooserButtonSkin.java MenuButtonSkin.java

Author: gbrown
Date: Fri Sep 17 15:56:21 2010
New Revision: 998181

URL: http://svn.apache.org/viewvc?rev=998181&view=rev
Log:
Minor bug fixes.

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ColorChooserButtonSkin.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuButtonSkin.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java?rev=998181&r1=998180&r2=998181&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java Fri Sep 17 15:56:21 2010
@@ -186,7 +186,10 @@ public abstract class CalendarButtonSkin
     public void enabledChanged(Component component) {
         super.enabledChanged(component);
 
-        pressed = false;
+        if (!component.isEnabled()) {
+            pressed = false;
+        }
+
         repaintComponent();
 
         calendarPopup.close();
@@ -196,14 +199,16 @@ public abstract class CalendarButtonSkin
     public void focusedChanged(Component component, Component obverseComponent) {
         super.focusedChanged(component, obverseComponent);
 
-        pressed = false;
         repaintComponent();
 
         // Close the popup if focus was transferred to a component whose
         // window is not the popup
-        if (!component.isFocused()
-            && !calendarPopup.containsFocus()) {
-            calendarPopup.close();
+        if (!component.isFocused()) {
+            pressed = false;
+
+            if (!calendarPopup.containsFocus()) {
+                calendarPopup.close();
+            }
         }
     }
 

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ColorChooserButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ColorChooserButtonSkin.java?rev=998181&r1=998180&r2=998181&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ColorChooserButtonSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ColorChooserButtonSkin.java Fri Sep 17 15:56:21 2010
@@ -199,7 +199,10 @@ public abstract class ColorChooserButton
     public void enabledChanged(Component component) {
         super.enabledChanged(component);
 
-        pressed = false;
+        if (!component.isEnabled()) {
+            pressed = false;
+        }
+
         repaintComponent();
 
         colorChooserPopup.close();
@@ -209,14 +212,16 @@ public abstract class ColorChooserButton
     public void focusedChanged(Component component, Component obverseComponent) {
         super.focusedChanged(component, obverseComponent);
 
-        pressed = false;
         repaintComponent();
 
         // Close the popup if focus was transferred to a component whose
         // window is not the popup
-        if (!component.isFocused()
-            && !colorChooserPopup.containsFocus()) {
-            colorChooserPopup.close();
+        if (!component.isFocused()) {
+            pressed = false;
+
+            if (!colorChooserPopup.containsFocus()) {
+                colorChooserPopup.close();
+            }
         }
     }
 

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuButtonSkin.java?rev=998181&r1=998180&r2=998181&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuButtonSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MenuButtonSkin.java Fri Sep 17 15:56:21 2010
@@ -95,7 +95,10 @@ public abstract class MenuButtonSkin ext
     public void enabledChanged(Component component) {
         super.enabledChanged(component);
 
-        pressed = false;
+        if (!component.isEnabled()) {
+            pressed = false;
+        }
+
         repaintComponent();
 
         menuPopup.close();
@@ -105,14 +108,16 @@ public abstract class MenuButtonSkin ext
     public void focusedChanged(Component component, Component obverseComponent) {
         super.focusedChanged(component, obverseComponent);
 
-        pressed = false;
         repaintComponent();
 
         // Close the popup if focus was transferred to a component whose
         // window is not the popup
-        if (!component.isFocused()
-            && !menuPopup.containsFocus()) {
-            menuPopup.close();
+        if (!component.isFocused()) {
+            pressed = false;
+
+            if (!menuPopup.containsFocus()) {
+                menuPopup.close();
+            }
         }
     }