mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 20:29:06 +07:00
Fixed mobile menu layout issues
This commit is contained in:
parent
5cd97f6ff1
commit
cbeac8e995
@ -290,8 +290,19 @@ public class HudFragment{
|
|||||||
|
|
||||||
Table wavesMain, editorMain;
|
Table wavesMain, editorMain;
|
||||||
|
|
||||||
cont.stack(wavesMain = new Table(), editorMain = new Table()).height(wavesMain.getPrefHeight())
|
cont.stack(wavesMain = new Table(), editorMain = new Table(), new Element(){
|
||||||
.name("waves/editor");
|
//this may seem insane, but adding an empty element of a specific height to this stack fixes layout issues on mobile.
|
||||||
|
|
||||||
|
{
|
||||||
|
visible = false;
|
||||||
|
touchable = Touchable.disabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getPrefHeight(){
|
||||||
|
return Scl.scl(120f);
|
||||||
|
}
|
||||||
|
}).name("waves/editor");
|
||||||
|
|
||||||
wavesMain.visible(() -> shown && !state.isEditor());
|
wavesMain.visible(() -> shown && !state.isEditor());
|
||||||
wavesMain.top().left().name = "waves";
|
wavesMain.top().left().name = "waves";
|
||||||
@ -342,11 +353,7 @@ public class HudFragment{
|
|||||||
.size(45f).update(m -> m.getStyle().imageUp = (Core.settings.getBool("editor-blocks-shown") ? Icon.upOpen : Icon.downOpen));
|
.size(45f).update(m -> m.getStyle().imageUp = (Core.settings.getBool("editor-blocks-shown") ? Icon.upOpen : Icon.downOpen));
|
||||||
}).top().left().row();
|
}).top().left().row();
|
||||||
|
|
||||||
t.collapser(blocks -> {
|
t.collapser(this::addBlockSelection, () -> Core.settings.getBool("editor-blocks-shown"));
|
||||||
addBlockSelection(blocks);
|
|
||||||
}, () -> Core.settings.getBool("editor-blocks-shown"));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}).width(dsize * 5 + 4f).top();
|
}).width(dsize * 5 + 4f).top();
|
||||||
if(mobile){
|
if(mobile){
|
||||||
|
Loading…
Reference in New Issue
Block a user