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 {
|
||||
padding: 0;
|
||||
padding-top: /*line height*/ 46px - h.font-size;
|
||||
spacing: 16px;
|
||||
alignment: start;
|
||||
if (has_back_button) : Text {
|
||||
font-weight: 900;
|
||||
font-size: 22px;
|
||||
font-size: 32px;
|
||||
text: "< ";
|
||||
color: DemoPalette.control_secoundary;
|
||||
TouchArea { clicked => { back() } }
|
||||
|
@ -62,7 +63,7 @@ export Page := Rectangle {
|
|||
|
||||
h := Text {
|
||||
font-weight: 900;
|
||||
font-size: 22px;
|
||||
font-size: 32px;
|
||||
color: DemoPalette.text_foreground_color;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,6 +159,7 @@ PrinterQueue := Rectangle {
|
|||
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
padding: parent.border_radius;
|
||||
|
||||
Text {
|
||||
text: "Printing-Queue";
|
||||
|
@ -174,10 +175,8 @@ PrinterQueue := Rectangle {
|
|||
alignment: start;
|
||||
padding-top: root.border_radius;
|
||||
padding-bottom: root.border_radius;
|
||||
|
||||
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
spacing: root.border_radius / 2;
|
||||
|
||||
for queue_item[idx] in root.printer_queue: PrintQueueElement {
|
||||
|
@ -187,7 +186,6 @@ PrinterQueue := Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export HomePage := Page {
|
||||
property <length> header_row_height: 40px;
|
||||
|
@ -209,7 +207,9 @@ export HomePage := Page {
|
|||
{ name: "USB", icon: @image-url("images/usb.svg") },
|
||||
]: ActionButton {
|
||||
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;
|
||||
height: button_height;
|
||||
icon: action.icon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue