mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
Make it possible to expand print queue item details
TODO: Animate the appearance/disappearance somehow...
This commit is contained in:
parent
f72e82254b
commit
3ccd2712f4
1 changed files with 69 additions and 0 deletions
|
@ -43,6 +43,17 @@ ActionButton := Rectangle {
|
||||||
TouchArea { clicked => { root.clicked() } }
|
TouchArea { clicked => { root.clicked() } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrintQueueDetailsLabel := Text {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #122F7B;
|
||||||
|
}
|
||||||
|
|
||||||
|
PrintQueueSeparator := Rectangle {
|
||||||
|
height: 1px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #BDC0D1;
|
||||||
|
}
|
||||||
|
|
||||||
PrinterQueue := Rectangle {
|
PrinterQueue := Rectangle {
|
||||||
property <[PrinterQueueItem]> printer_queue;
|
property <[PrinterQueueItem]> printer_queue;
|
||||||
|
|
||||||
|
@ -69,6 +80,8 @@ PrinterQueue := Rectangle {
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
background: DemoPalette.printer_queue_item_background_color;
|
background: DemoPalette.printer_queue_item_background_color;
|
||||||
|
|
||||||
|
property <bool> expanded;
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
padding: parent.border_radius;
|
padding: parent.border_radius;
|
||||||
spacing: 4px;
|
spacing: 4px;
|
||||||
|
@ -83,6 +96,62 @@ PrinterQueue := Rectangle {
|
||||||
overflow: elide;
|
overflow: elide;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (expanded) : GridLayout {
|
||||||
|
Row {
|
||||||
|
PrintQueueDetailsLabel {
|
||||||
|
text: "Owner";
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: queue_item.owner;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
PrintQueueSeparator {
|
||||||
|
colspan: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
PrintQueueDetailsLabel {
|
||||||
|
text: "Pages";
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: queue_item.pages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
PrintQueueSeparator {
|
||||||
|
colspan: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
PrintQueueDetailsLabel {
|
||||||
|
text: "Size";
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: queue_item.pages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
PrintQueueSeparator {
|
||||||
|
colspan: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
PrintQueueDetailsLabel {
|
||||||
|
text: "Submitted";
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: queue_item.submission_date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TouchArea {
|
||||||
|
clicked => {
|
||||||
|
expanded = !expanded;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue