You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/10/09 15:14:20 UTC
svn commit: r823541 -
/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
Author: tvolkert
Date: Fri Oct 9 13:14:20 2009
New Revision: 823541
URL: http://svn.apache.org/viewvc?rev=823541&view=rev
Log:
Changed ComponentSkin to call scrollAreaToVisible on focus traversal instead of on all focus changes to get the user experience more inline with Windows, OS X, and Linux.
Modified:
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java?rev=823541&r1=823540&r2=823541&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java Fri Oct 9 13:14:20 2009
@@ -240,12 +240,7 @@
@Override
public void focusedChanged(Component component, Component obverseComponent) {
- // Ensure that the component is visible if it is in a viewport
- if (component.isFocused()
- && obverseComponent != null
- && obverseComponent.getWindow() == component.getWindow()) {
- component.scrollAreaToVisible(0, 0, getWidth(), getHeight());
- }
+ // No-op
}
// Component mouse events
@@ -324,7 +319,13 @@
Component focusedComponent = Component.getFocusedComponent();
- consumed = (previousFocusedComponent != focusedComponent);
+ if (previousFocusedComponent != focusedComponent) {
+ // Ensure that the focused component is visible if it is in a viewport
+ focusedComponent.scrollAreaToVisible(0, 0, focusedComponent.getWidth(),
+ focusedComponent.getHeight());
+
+ consumed = true;
+ }
}
return consumed;