Commit 59917864 authored by Drahomír Karchňák's avatar Drahomír Karchňák

#767 Minor refactoring

parent 2fe4baa1
......@@ -163,13 +163,12 @@ public class MainMenu extends AbstractMenu {
if(scrollPane == null || scrollPane.isScrollY() == !disable)
return;
if(disable) {
scrollPane.setScrollingDisabled(true, true);
scrollPane.setScrollingDisabled(true, disable);
if(disable)
Tablexia.getActualScreen().setScrollableLayoutFocus();
}else {
scrollPane.setScrollingDisabled(true, false);
else
Tablexia.getActualScreen().getStage().setScrollFocus(scrollPane);
}
scrollPane.layout();
}
......
......@@ -255,29 +255,22 @@ public class EncyclopediaScreen extends AbstractTablexiaScreen<Void> {
menu.setName(MENU);
menu.updateSize(rightPanelWidth);
}
private void prepareMouseListener() {
if (TablexiaSettings.getInstance().getPlatform() == TablexiaSettings.Platform.DESKTOP) {
container.addListener(new InputListener() {
@Override
public boolean mouseMoved(InputEvent event, float x, float y) {
if (x > rightPanePosition && getStage().getScrollFocus() != menuScrollPane) {
getStage().setScrollFocus(menuScrollPane);
return true;
} else if (x < rightPanePosition && getStage().getScrollFocus() != contentScrollPane) {
getStage().setScrollFocus(contentScrollPane);
return true;
}
return false;
return super.mouseMoved(event, x, y);
}
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment