Skip to content

Commit

Permalink
Fixing clicking first to activate scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Siebeneicker committed Sep 26, 2020
1 parent e006725 commit a6826fa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion DelvEdit/src/com/interrupt/dungeoneer/editor/ui/FilePicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.*;
import com.badlogic.gdx.scenes.scene2d.ui.TextField.TextFieldListener;
Expand Down Expand Up @@ -238,7 +239,18 @@ public FilePicker disableDirectoryBrowsing() {
public Dialog show(Stage stage) {
final Table content = getContentTable();
content.add(fileListLabel).colspan(2).top().left().expandX().fillX().row();

ScrollPane pane = new ScrollPane(fileList, skin);
pane.addListener(new InputListener() {
public void enter(InputEvent event, float x, float y, int pointer, Actor fromActor) {
getStage().setScrollFocus(fromActor);
}

public void exit(InputEvent event, float x, float y, int pointer, Actor toActor) {
getStage().setScrollFocus(null);
}
});

content.add(pane).size(300, 350).colspan(2).fill().expand().row();

if (fileNameEnabled) {
Expand Down Expand Up @@ -345,4 +357,4 @@ protected void result(Object object) {
return pick;
}

}
}

0 comments on commit a6826fa

Please sign in to comment.