Fixed list scroll focus.

This commit is contained in:
Nathan Sweet 2017-08-23 12:14:32 +02:00
parent 3382894f71
commit df9f7ba040

View File

@ -711,11 +711,11 @@ public class SkeletonViewer extends ApplicationAdapter {
InputListener scrollFocusListener = new InputListener() { InputListener scrollFocusListener = new InputListener() {
public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) { public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) {
stage.setScrollFocus(event.getListenerActor()); if (pointer == -1) stage.setScrollFocus(event.getListenerActor());
} }
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) {
if (stage.getScrollFocus() == event.getListenerActor()) stage.setScrollFocus(null); if (pointer == -1 && stage.getScrollFocus() == event.getListenerActor()) stage.setScrollFocus(null);
} }
}; };
@ -730,7 +730,7 @@ public class SkeletonViewer extends ApplicationAdapter {
} }
} }
}); });
animationList.addListener(scrollFocusListener); animationScroll.addListener(scrollFocusListener);
loopCheckbox.addListener(new ChangeListener() { loopCheckbox.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) { public void changed (ChangeEvent event, Actor actor) {
@ -750,7 +750,7 @@ public class SkeletonViewer extends ApplicationAdapter {
} }
} }
}); });
skinList.addListener(scrollFocusListener); skinScroll.addListener(scrollFocusListener);
ChangeListener trackButtonListener = new ChangeListener() { ChangeListener trackButtonListener = new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) { public void changed (ChangeEvent event, Actor actor) {