aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2010-12-15 14:00:48 -0800
committerAndroid Code Review <code-review@android.com>2010-12-15 14:00:48 -0800
commit1a92c8f793139e3a027941907d949d3685c73628 (patch)
treea8f35bcd96463ce2362aeaa5a348b107d6e0ed88 /eclipse
parentd102de382cf1e2daad85e246a110549b8ad98d1c (diff)
parent5773c108d0403a9b63dad45ef242f99f0401e40f (diff)
downloadsdk-1a92c8f793139e3a027941907d949d3685c73628.zip
sdk-1a92c8f793139e3a027941907d949d3685c73628.tar.gz
sdk-1a92c8f793139e3a027941907d949d3685c73628.tar.bz2
Merge "Fix Palette scrollbar bug"
Diffstat (limited to 'eclipse')
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java
index e3bbd00..2571753 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java
@@ -236,14 +236,20 @@ public class PaletteComposite extends Composite {
// Thumb size is the ratio between root view and visible height.
float ft = ry > 0 ? (float)vy / ry : 1;
int thumb = (int) Math.ceil(y * ft);
+ if (thumb < 1) {
+ thumb = 1;
+ }
y += thumb;
if (y != max) {
+ int minimum = mVBar.getMinimum();
mVBar.setEnabled(y > 0);
- mVBar.setMaximum(y < 0 ? 1 : y);
- mVBar.setSelection((int) (y * current));
- mVBar.setThumb(thumb);
+ int maximum = y < 0 ? 1 : y;
+ int selection = (int) (y * current);
+ int increment = 20;
+ int pageIncrement = thumb;
+ mVBar.setValues(selection, minimum, maximum, thumb, increment, pageIncrement);
scrollScrollbar();
return true;
}