[view] fixes

This commit is contained in:
2019-07-13 12:48:01 +03:00
parent 6274bd271e
commit b488e6f88a
3 changed files with 18 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ class InputView extends TextView {
hintTextField = buildHintTextField(); hintTextField = buildHintTextField();
content.addChild(hintTextField); content.addChild(hintTextField);
textFormat.align = TextFormatAlign.LEFT; font.align = TextFormatAlign.LEFT;
} }
private function set_hint(value:String):String { private function set_hint(value:String):String {

View File

@@ -16,6 +16,18 @@ class GeometryStyle implements IStyle<IView<Dynamic>> {
view.geometry.padding = geometry.padding.clone(); view.geometry.padding = geometry.padding.clone();
update = true; update = true;
} }
if (!geometry.margin.empty) {
view.geometry.margin = geometry.margin.clone();
update = true;
}
if (geometry.width.value > 0) {
view.geometry.width = geometry.width;
update = true;
}
if (geometry.height.value > 0) {
view.geometry.height = geometry.height;
update = true;
}
if (update) { if (update) {
view.toUpdateParent(); view.toUpdateParent();
} }

View File

@@ -125,12 +125,15 @@ class Theme implements ITheme {
]; ];
} }
public function text(?color:Color):StyleSet { public function text(?color:Color, ?size:Null<Int>):StyleSet {
if (color == null) { if (color == null) {
color = colors.text; color = colors.text;
} }
if (size == null) {
size = baseFontSize;
}
return [ return [
new FontStyle(new FontPreset(font.name, font.embed, color, baseFontSize)), new FontStyle(new FontPreset(font.name, font.embed, color, size)),
]; ];
} }