mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
Use dashed properties for text alignment
This commit is contained in:
parent
3886ed329f
commit
c85aa9a758
4 changed files with 18 additions and 18 deletions
|
@ -26,7 +26,7 @@ export FaxPage := Page {
|
|||
x: preview.x + preview.width + 20px;
|
||||
y: preview.y + 10px;
|
||||
width: parent.width - x - 40px;
|
||||
horizontal_alignment: align_center;
|
||||
horizontal-alignment: align-center;
|
||||
font_size: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
@ -58,8 +58,8 @@ export FaxPage := Page {
|
|||
Text {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
horizontal_alignment: align_center;
|
||||
vertical_alignment: align_center;
|
||||
horizontal-alignment: align-center;
|
||||
vertical-alignment: align-center;
|
||||
color: white;
|
||||
text: num >= 0 ? num : "⌫";
|
||||
}
|
||||
|
|
|
@ -119,8 +119,8 @@ MainWindow := Window {
|
|||
x: 5px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
horizontal_alignment: align_center;
|
||||
vertical_alignment: align_center;
|
||||
horizontal-alignment: align-center;
|
||||
vertical-alignment: align-center;
|
||||
text: page_info.text;
|
||||
font_size: 28px;
|
||||
animate x, y {
|
||||
|
@ -155,7 +155,7 @@ MainWindow := Window {
|
|||
img.height: root.height * 10%;
|
||||
text.y: 0phx;
|
||||
text.x: root.height * 25%;
|
||||
//text.horizontal_alignment: align_left;
|
||||
//text.horizontal-alignment: align-left;
|
||||
}
|
||||
pressed when root.active_page == 0 && touch.pressed : {
|
||||
width: root.width / 5 + 6px;
|
||||
|
|
|
@ -51,8 +51,8 @@ export Button := Rectangle {
|
|||
Text {
|
||||
text: root.text;
|
||||
font_size: root.font_size;
|
||||
horizontal_alignment: align_center;
|
||||
vertical_alignment: align_center;
|
||||
horizontal-alignment: align-center;
|
||||
vertical-alignment: align-center;
|
||||
color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ export CheckBox := Rectangle {
|
|||
Text {
|
||||
x: indicator.width + 8px;
|
||||
text: root.text;
|
||||
vertical_alignment: align_center;
|
||||
vertical-alignment: align-center;
|
||||
width: parent.width - self.x;
|
||||
height: parent.height;
|
||||
color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
|
||||
|
@ -142,8 +142,8 @@ SpinBoxButton := Rectangle {
|
|||
y: touch.pressed ? 1px : 0px;
|
||||
width: parent.width;
|
||||
height: parent.height;
|
||||
vertical_alignment: align_center;
|
||||
horizontal_alignment: align_center;
|
||||
vertical-alignment: align-center;
|
||||
horizontal-alignment: align-center;
|
||||
text: root.text;
|
||||
font_size: root.font_size;
|
||||
color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
|
||||
|
@ -191,8 +191,8 @@ export SpinBox := Rectangle {
|
|||
x: parent.height + 15px;
|
||||
width: plus_button.x - self.x - 15px;
|
||||
height: parent.height;
|
||||
horizontal_alignment: align_center;
|
||||
vertical_alignment: align_center;
|
||||
horizontal-alignment: align-center;
|
||||
vertical-alignment: align-center;
|
||||
color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
|
||||
}
|
||||
}
|
||||
|
@ -457,8 +457,8 @@ export ComboBox := Rectangle {
|
|||
|
||||
t := Text {
|
||||
text <=> root.current_value;
|
||||
horizontal_alignment: align_left;
|
||||
vertical_alignment: align_center;
|
||||
horizontal-alignment: align-left;
|
||||
vertical-alignment: align-center;
|
||||
color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ export ComboBox := Rectangle {
|
|||
text:"▼";
|
||||
color: root.enabled ? Palette.text_color : Palette.text_color_disabled;
|
||||
horizontal-stretch: 0;
|
||||
vertical-alignment: align_center;
|
||||
vertical-alignment: align-center;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,8 +49,8 @@ ButtonRectangle := Rectangle {
|
|||
text: button_text;
|
||||
width: root.width;
|
||||
height: root.height;
|
||||
horizontal_alignment: align_left;
|
||||
vertical_alignment: align_center;
|
||||
horizontal-alignment: align-left;
|
||||
vertical-alignment: align-center;
|
||||
}
|
||||
animate x { duration: 500ms; }
|
||||
animate y { duration: 500ms; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue