UI fixes
This commit is contained in:
@@ -258,7 +258,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
selectRequests.clear();
|
selectRequests.clear();
|
||||||
mode = none;
|
mode = none;
|
||||||
block = null;
|
block = null;
|
||||||
}).width(155f);
|
}).width(155f).margin(16f);
|
||||||
});
|
});
|
||||||
|
|
||||||
group.fill(t -> {
|
group.fill(t -> {
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ public class Fonts{
|
|||||||
if(g == null) throw new IllegalArgumentException("No glyph: " + glyph + " (" + (int)glyph + ")");
|
if(g == null) throw new IllegalArgumentException("No glyph: " + glyph + " (" + (int)glyph + ")");
|
||||||
|
|
||||||
float size = Math.max(g.width, g.height);
|
float size = Math.max(g.width, g.height);
|
||||||
float aspect = (float)g.height / g.width;
|
|
||||||
TextureRegionDrawable draw = new TextureRegionDrawable(new TextureRegion(font.getRegion().getTexture(), g.u, g.v2, g.u2, g.v)){
|
TextureRegionDrawable draw = new TextureRegionDrawable(new TextureRegion(font.getRegion().getTexture(), g.u, g.v2, g.u2, g.v)){
|
||||||
@Override
|
@Override
|
||||||
public void draw(float x, float y, float width, float height){
|
public void draw(float x, float y, float width, float height){
|
||||||
@@ -173,6 +172,19 @@ public class Fonts{
|
|||||||
Draw.rect(region, cx + g.width/2f, cy + g.height/2f, g.width, g.height);
|
Draw.rect(region, cx + g.width/2f, cy + g.height/2f, g.width, g.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation){
|
||||||
|
width *= scaleX;
|
||||||
|
height *= scaleY;
|
||||||
|
Draw.color(Tmp.c1.set(tint).mul(Draw.getColor()).toFloatBits());
|
||||||
|
float cx = x + width/2f - g.width/2f, cy = y + height/2f - g.height/2f;
|
||||||
|
cx = (int)cx;
|
||||||
|
cy = (int)cy;
|
||||||
|
originX = g.width/2f;
|
||||||
|
originY = g.height/2f;
|
||||||
|
Draw.rect(region, cx + g.width/2f, cy + g.height/2f, g.width, g.height, originX, originY, rotation);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float imageSize(){
|
public float imageSize(){
|
||||||
return size;
|
return size;
|
||||||
|
|||||||
@@ -95,11 +95,16 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onResize(this::setup);
|
onResize(() -> {
|
||||||
|
setup();
|
||||||
|
refreshLocal();
|
||||||
|
refreshRemote();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupRemote(){
|
void setupRemote(){
|
||||||
remote.clear();
|
remote.clear();
|
||||||
|
|
||||||
for(Server server : servers){
|
for(Server server : servers){
|
||||||
//why are java lambdas this bad
|
//why are java lambdas this bad
|
||||||
TextButton[] buttons = {null};
|
TextButton[] buttons = {null};
|
||||||
@@ -139,16 +144,16 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}).margin(3f).pad(2).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton(Icon.refresh, Styles.emptyi, () -> {
|
inner.addImageButton(Icon.refresh, Styles.emptyi, () -> {
|
||||||
refreshServer(server);
|
refreshServer(server);
|
||||||
}).margin(3f).pad(2).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton(Icon.pencil, Styles.emptyi, () -> {
|
inner.addImageButton(Icon.pencil, Styles.emptyi, () -> {
|
||||||
renaming = server;
|
renaming = server;
|
||||||
add.show();
|
add.show();
|
||||||
}).margin(3f).pad(2).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton(Icon.trash, Styles.emptyi, () -> {
|
inner.addImageButton(Icon.trash, Styles.emptyi, () -> {
|
||||||
ui.showConfirm("$confirm", "$server.delete", () -> {
|
ui.showConfirm("$confirm", "$server.delete", () -> {
|
||||||
@@ -157,7 +162,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
setupRemote();
|
setupRemote();
|
||||||
refreshRemote();
|
refreshRemote();
|
||||||
});
|
});
|
||||||
}).margin(3f).pad(2).pad(6).top().right();
|
}).margin(3f).pad(6).top().right();
|
||||||
|
|
||||||
button.row();
|
button.row();
|
||||||
|
|
||||||
@@ -266,7 +271,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
cont.addCenteredImageTextButton("$server.add", Icon.add, () -> {
|
cont.addCenteredImageTextButton("$server.add", Icon.add, () -> {
|
||||||
renaming = null;
|
renaming = null;
|
||||||
add.show();
|
add.show();
|
||||||
}).marginLeft(6).width(w).height(80f).update(button -> {
|
}).marginLeft(10).width(w).height(80f).update(button -> {
|
||||||
float pw = w;
|
float pw = w;
|
||||||
float pad = 0f;
|
float pad = 0f;
|
||||||
if(pane.getChildren().first().getPrefHeight() > pane.getHeight()){
|
if(pane.getChildren().first().getPrefHeight() > pane.getHeight()){
|
||||||
@@ -363,7 +368,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
float targetWidth(){
|
float targetWidth(){
|
||||||
return Core.graphics.isPortrait() ? 350f : 500f;
|
return Math.min(Core.graphics.getWidth() / Scl.scl() * 0.9f, 500f);//Core.graphics.isPortrait() ? 350f : 500f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|||||||
@@ -244,9 +244,12 @@ public class PlacementFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
blockTable.act(0f);
|
blockTable.act(0f);
|
||||||
blockPane.act(0f);
|
|
||||||
blockPane.setScrollYForce(scrollPositions.get(currentCategory, 0));
|
blockPane.setScrollYForce(scrollPositions.get(currentCategory, 0));
|
||||||
Core.app.post(() -> blockPane.setScrollYForce(scrollPositions.get(currentCategory, 0)));
|
Core.app.post(() -> {
|
||||||
|
blockPane.setScrollYForce(scrollPositions.get(currentCategory, 0));
|
||||||
|
blockPane.act(0f);
|
||||||
|
blockPane.layout();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
//top table with hover info
|
//top table with hover info
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=ca797d336b86bfe091162b5e5dc73521e04e4817
|
archash=bf5f253d458e0b8bddf9efcc3642a644f4b48fb6
|
||||||
|
|||||||
Reference in New Issue
Block a user