mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
Fix placement of the printer name label and the printer queue items
This commit is contained in:
parent
d3672a771e
commit
341be9cb18
2 changed files with 12 additions and 11 deletions
|
@ -50,11 +50,12 @@ export Page := Rectangle {
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
padding-top: /*line height*/ 46px - h.font-size;
|
||||||
spacing: 16px;
|
spacing: 16px;
|
||||||
alignment: start;
|
alignment: start;
|
||||||
if (has_back_button) : Text {
|
if (has_back_button) : Text {
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
font-size: 22px;
|
font-size: 32px;
|
||||||
text: "< ";
|
text: "< ";
|
||||||
color: DemoPalette.control_secoundary;
|
color: DemoPalette.control_secoundary;
|
||||||
TouchArea { clicked => { back() } }
|
TouchArea { clicked => { back() } }
|
||||||
|
@ -62,7 +63,7 @@ export Page := Rectangle {
|
||||||
|
|
||||||
h := Text {
|
h := Text {
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
font-size: 22px;
|
font-size: 32px;
|
||||||
color: DemoPalette.text_foreground_color;
|
color: DemoPalette.text_foreground_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,7 @@ PrinterQueue := Rectangle {
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
|
padding: parent.border_radius;
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "Printing-Queue";
|
text: "Printing-Queue";
|
||||||
|
@ -174,10 +175,8 @@ PrinterQueue := Rectangle {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
padding-top: root.border_radius;
|
padding-top: root.border_radius;
|
||||||
padding-bottom: root.border_radius;
|
padding-bottom: root.border_radius;
|
||||||
|
padding-left: 0px;
|
||||||
|
padding-right: 0px;
|
||||||
VerticalLayout {
|
|
||||||
alignment: start;
|
|
||||||
spacing: root.border_radius / 2;
|
spacing: root.border_radius / 2;
|
||||||
|
|
||||||
for queue_item[idx] in root.printer_queue: PrintQueueElement {
|
for queue_item[idx] in root.printer_queue: PrintQueueElement {
|
||||||
|
@ -186,7 +185,6 @@ PrinterQueue := Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export HomePage := Page {
|
export HomePage := Page {
|
||||||
|
@ -209,7 +207,9 @@ export HomePage := Page {
|
||||||
{ name: "USB", icon: @image-url("images/usb.svg") },
|
{ name: "USB", icon: @image-url("images/usb.svg") },
|
||||||
]: ActionButton {
|
]: ActionButton {
|
||||||
x: mod(idx, 2) * (button_width + button_spacing);
|
x: mod(idx, 2) * (button_width + button_spacing);
|
||||||
y: floor(idx / 2) * (button_height + button_spacing) + /* header row height */ 40px;
|
y: floor(idx / 2) * (button_height + button_spacing)
|
||||||
|
+ /* header row height */ 46px
|
||||||
|
+ /* top-padding of printer queue */ 27px; // align with the first item of the printer queue
|
||||||
width: button_width;
|
width: button_width;
|
||||||
height: button_height;
|
height: button_height;
|
||||||
icon: action.icon;
|
icon: action.icon;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue