feat(client): update elements sizes

This commit is contained in:
2024-05-30 16:14:03 +03:00
parent 16a5adefad
commit d6af58875d
6 changed files with 30 additions and 101 deletions

View File

@@ -24,7 +24,7 @@ class AppTheme extends Theme {
}
public function new() {
super({embed: true}, COLORS, {base: "4h"});
super({embed: true}, COLORS, {base: "2.7h", big: "4h", veryBig: "4.5h"});
}
override private function reload():Void {
@@ -78,9 +78,9 @@ class AppTheme extends Theme {
], ["text.box"]));
register(new Style("button.level", [
"font.size" => fontSize.veryBig,
"geometry.width" => SizeValue.fromInt(64),
"geometry.height" => SizeValue.fromInt(64),
"font.size" => fontSize.big,
"geometry.width" => SizeValue.fromString("12h"),
"geometry.height" => SizeValue.fromString("12h"),
"geometry.padding" => Box.fromFloat(0),
], ["button"]));
@@ -108,13 +108,13 @@ class AppTheme extends Theme {
register(new Style("window.close", [
"skin" => function() return new ButtonSVGSkin(Assets.getText("resources/image/icon/window-close-solid.svg"), colors.light),
"geometry.width" => SizeValue.fromInt(36),
"geometry.height" => SizeValue.fromInt(36),
"geometry.width" => SizeValue.fromString("8h"),
"geometry.height" => SizeValue.fromString("8h"),
]));
register(new Style("icon.tank", [
"geometry.width" => SizeValue.fromInt(42),
"geometry.height" => SizeValue.fromInt(42),
"geometry.width" => SizeValue.fromString("8h"),
"geometry.height" => SizeValue.fromString("8h"),
"skin.fillType" => FillType.DEFAULT,
]));
@@ -165,16 +165,14 @@ class AppTheme extends Theme {
}
private function registerButton(name:String, resource:String, solid:Bool = false):Void {
var size = Device.isMobile() ? 64 : 42;
var smallSize = Device.isMobile() ? 42 : 32;
register(new Style('button.$name', [
"geometry.width" => SizeValue.fromInt(size),
"geometry.height" => SizeValue.fromInt(size),
"geometry.width" => SizeValue.fromString("8h"),
"geometry.height" => SizeValue.fromString("8h"),
"skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid),
]));
register(new Style('button.$name.small', [
"geometry.width" => SizeValue.fromInt(smallSize),
"geometry.height" => SizeValue.fromInt(smallSize),
"geometry.width" => SizeValue.fromString("5h"),
"geometry.height" => SizeValue.fromString("5h"),
"skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid),
]));
}

View File

@@ -1,7 +1,7 @@
---
style: button.menu
geometry.width: 200
geometry.height: 130
geometry.width: 35h
geometry.height: 20h
geometry.padding: 5
layout.hAlign: center
layout.vAlign: middle
@@ -10,6 +10,7 @@ content.mouseChildren: false
views:
- id: label
$type: hw.view.form.LabelView
font.size: 22
font.size: 4h
- id: state
$type: hw.view.form.LabelView
font.size: 3.5h

View File

@@ -3,9 +3,9 @@ layout.margin: 5
views:
- id: action
$type: hw.view.form.LabelView
geometry.width: 180
geometry.width: "20w"
style: text.box
- id: key
$type: hw.view.form.LabelView
geometry.width: 250
geometry.width: "25w"
style: text.box