[client] icon button size for mobile devices
This commit is contained in:
@@ -165,14 +165,16 @@ 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(42),
|
||||
"geometry.height" => SizeValue.fromInt(42),
|
||||
"geometry.width" => SizeValue.fromInt(size),
|
||||
"geometry.height" => SizeValue.fromInt(size),
|
||||
"skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid),
|
||||
]));
|
||||
register(new Style('button.$name.small', [
|
||||
"geometry.width" => SizeValue.fromInt(32),
|
||||
"geometry.height" => SizeValue.fromInt(32),
|
||||
"geometry.width" => SizeValue.fromInt(smallSize),
|
||||
"geometry.height" => SizeValue.fromInt(smallSize),
|
||||
"skin" => function() return new ButtonSVGSkin(Assets.getText('resources/image/icon/$resource'), colors.light, solid),
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ class Client {
|
||||
L.d(TAG, 'Debug: ${Const.DEBUG}');
|
||||
L.i(TAG, 'Version: ${Const.VERSION}');
|
||||
L.i(TAG, 'Build: ${Const.BUILD}');
|
||||
L.i(TAG, 'Mobile: ${Device.isMobile()}');
|
||||
#if linux
|
||||
LinuxIcon.apply();
|
||||
#end
|
||||
|
||||
@@ -64,13 +64,6 @@ using ru.m.tankz.view.ViewUtil;
|
||||
}
|
||||
}
|
||||
|
||||
private function packButtonFactory(index:Int, packId:PackId):ButtonView {
|
||||
var result = new ButtonView();
|
||||
result.style = "button.menu";
|
||||
result.text = packId.toPackLabel();
|
||||
return result;
|
||||
}
|
||||
|
||||
private function startGame(packId:PackId):Void {
|
||||
gameInit = LOCAL({state: new GameState(packId.type), level: null});
|
||||
switcher.change(LevelFrame.ID, packId);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
style: button.menu
|
||||
geometry.width: 200
|
||||
geometry.height: 150
|
||||
geometry.height: 130
|
||||
geometry.padding: 5
|
||||
layout.hAlign: center
|
||||
layout.vAlign: middle
|
||||
|
||||
Reference in New Issue
Block a user