layout cleanup

This commit is contained in:
sharlottes
2022-06-05 01:39:15 +09:00
parent c5026ffed3
commit 7091236b4e
3 changed files with 10 additions and 11 deletions

View File

@@ -55,6 +55,8 @@ public class SUtils {
} }
public static <T extends Number> String formatNumber(T number){ public static <T extends Number> String formatNumber(T number){
if(number instanceof Integer integ) return integ.toString();
if(number.longValue() % 10 == 0) return String.valueOf(number.intValue());
return formatNumber(number, 1); return formatNumber(number, 1);
} }
public static <T extends Number> String formatNumber(T number, int step){ public static <T extends Number> String formatNumber(T number, int step){

View File

@@ -157,8 +157,6 @@ class UnitWindow extends Window {
getDrawable().draw(x, y, width, height); getDrawable().draw(x, y, width, height);
ScissorStack.pop(); ScissorStack.pop();
} }
Log.info("----------------------");
} }
}; };
icon.addListener(new InputListener(){ icon.addListener(new InputListener(){

View File

@@ -52,18 +52,18 @@ public class Window extends Table{
table(t -> { table(t -> {
// icon and title // icon and title
t.table(Tex.buttonEdge1, b -> { t.table(Tex.buttonEdge1, b -> {
b.top().left(); b.left();
b.image(() -> icon == null ? Icon.none.getRegion() : icon.getRegion()).size(20f).padLeft(15).top().left(); b.image(icon.getRegion()).size(20f).padLeft(15);
b.pane(Styles.noBarPane, p -> { b.pane(Styles.noBarPane, p -> {
p.top().left(); p.left();
p.labelWrap(() -> Core.bundle.get("window."+name+".name")).padLeft(20).top().left().get().setAlignment(Align.topLeft); p.add(Core.bundle.get("window."+name+".name")).padLeft(20);
}).left().height(40f).growX().get().setScrollingDisabled(true, true); }).grow().get().setScrollingDisabled(false, true);
}).maxHeight(40f).grow(); }).grow();
// exit button // exit button
t.table(Tex.buttonEdge3, b -> { t.table(Tex.buttonEdge3, b -> {
b.button(Icon.cancel, Styles.emptyi, () -> shown = false); b.button(Icon.cancel, Styles.emptyi, () -> shown = false);
}).maxHeight(40f).width(80f).growY(); }).width(80f).growY();
// handles the dragging. // handles the dragging.
t.touchable = Touchable.enabled; t.touchable = Touchable.enabled;
@@ -88,8 +88,7 @@ public class Window extends Table{
lastY = v.y; lastY = v.y;
} }
}); });
}).top().height(40f).growX(); }).height(6f*8).top().grow().row();
row();
} }
protected void bottomBar(){ protected void bottomBar(){