Use dashed properties for text alignment

This commit is contained in:
Simon Hausmann 2020-11-11 09:35:09 +01:00
parent 3886ed329f
commit c85aa9a758
4 changed files with 18 additions and 18 deletions

View file

@ -26,7 +26,7 @@ export FaxPage := Page {
x: preview.x + preview.width + 20px; x: preview.x + preview.width + 20px;
y: preview.y + 10px; y: preview.y + 10px;
width: parent.width - x - 40px; width: parent.width - x - 40px;
horizontal_alignment: align_center; horizontal-alignment: align-center;
font_size: 40px; font_size: 40px;
height: 40px; height: 40px;
} }
@ -58,8 +58,8 @@ export FaxPage := Page {
Text { Text {
width: 100%; width: 100%;
height: 100%; height: 100%;
horizontal_alignment: align_center; horizontal-alignment: align-center;
vertical_alignment: align_center; vertical-alignment: align-center;
color: white; color: white;
text: num >= 0 ? num : "⌫"; text: num >= 0 ? num : "⌫";
} }

View file

@ -119,8 +119,8 @@ MainWindow := Window {
x: 5px; x: 5px;
width: 100%; width: 100%;
height: 100%; height: 100%;
horizontal_alignment: align_center; horizontal-alignment: align-center;
vertical_alignment: align_center; vertical-alignment: align-center;
text: page_info.text; text: page_info.text;
font_size: 28px; font_size: 28px;
animate x, y { animate x, y {
@ -155,7 +155,7 @@ MainWindow := Window {
img.height: root.height * 10%; img.height: root.height * 10%;
text.y: 0phx; text.y: 0phx;
text.x: root.height * 25%; text.x: root.height * 25%;
//text.horizontal_alignment: align_left; //text.horizontal-alignment: align-left;
} }
pressed when root.active_page == 0 && touch.pressed : { pressed when root.active_page == 0 && touch.pressed : {
width: root.width / 5 + 6px; width: root.width / 5 + 6px;

View file

@ -51,8 +51,8 @@ export Button := Rectangle {
Text { Text {
text: root.text; text: root.text;
font_size: root.font_size; font_size: root.font_size;
horizontal_alignment: align_center; horizontal-alignment: align-center;
vertical_alignment: align_center; vertical-alignment: align-center;
color: root.enabled ? Palette.text_color : Palette.text_color_disabled; color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
} }
} }
@ -105,7 +105,7 @@ export CheckBox := Rectangle {
Text { Text {
x: indicator.width + 8px; x: indicator.width + 8px;
text: root.text; text: root.text;
vertical_alignment: align_center; vertical-alignment: align-center;
width: parent.width - self.x; width: parent.width - self.x;
height: parent.height; height: parent.height;
color: root.enabled ? Palette.text_color : Palette.text_color_disabled; color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
@ -142,8 +142,8 @@ SpinBoxButton := Rectangle {
y: touch.pressed ? 1px : 0px; y: touch.pressed ? 1px : 0px;
width: parent.width; width: parent.width;
height: parent.height; height: parent.height;
vertical_alignment: align_center; vertical-alignment: align-center;
horizontal_alignment: align_center; horizontal-alignment: align-center;
text: root.text; text: root.text;
font_size: root.font_size; font_size: root.font_size;
color: root.enabled ? Palette.text_color : Palette.text_color_disabled; color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
@ -191,8 +191,8 @@ export SpinBox := Rectangle {
x: parent.height + 15px; x: parent.height + 15px;
width: plus_button.x - self.x - 15px; width: plus_button.x - self.x - 15px;
height: parent.height; height: parent.height;
horizontal_alignment: align_center; horizontal-alignment: align-center;
vertical_alignment: align_center; vertical-alignment: align-center;
color: root.enabled ? Palette.text_color : Palette.text_color_disabled; color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
} }
} }
@ -457,8 +457,8 @@ export ComboBox := Rectangle {
t := Text { t := Text {
text <=> root.current_value; text <=> root.current_value;
horizontal_alignment: align_left; horizontal-alignment: align-left;
vertical_alignment: align_center; vertical-alignment: align-center;
color: root.enabled ? Palette.text_color : Palette.text_color_disabled; color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
horizontal-stretch: 1; horizontal-stretch: 1;
} }
@ -466,7 +466,7 @@ export ComboBox := Rectangle {
text:"▼"; text:"▼";
color: root.enabled ? Palette.text_color : Palette.text_color_disabled; color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
horizontal-stretch: 0; horizontal-stretch: 0;
vertical-alignment: align_center; vertical-alignment: align-center;
} }
} }

View file

@ -49,8 +49,8 @@ ButtonRectangle := Rectangle {
text: button_text; text: button_text;
width: root.width; width: root.width;
height: root.height; height: root.height;
horizontal_alignment: align_left; horizontal-alignment: align-left;
vertical_alignment: align_center; vertical-alignment: align-center;
} }
animate x { duration: 500ms; } animate x { duration: 500ms; }
animate y { duration: 500ms; } animate y { duration: 500ms; }