aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Drawer.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-15 11:28:32 +0200
committerDanilo M. <danix@danix.xyz>2026-10-15 11:28:32 +0200
commit3345afa2ae8f9c8159548fc23e5b4bf8f1fd9035 (patch)
tree5daea028a2e48d6e44f50027687288553cba792e /desktop/Drawer.qml
parent98fc6036ee817a92810e060c80d48aa6a936a1ab (diff)
downloadquickshell-3345afa2ae8f9c8159548fc23e5b4bf8f1fd9035.tar.gz
quickshell-3345afa2ae8f9c8159548fc23e5b4bf8f1fd9035.zip
feat(desktop): performance and clipboard pages, a scrolling tile grid
The tile grid sits in a Flickable capped at three rows, so the fourth row the new modules bring scrolls inside that box instead of eating the notification space; a thin accent bar in the margin shows only when a row is hidden. Tiles are reordered with the everyday ones first. Performance shows the island's PerfPanel in a Page, with a tile line of CPU and RAM and the warning dot. Perf.detailed is now a count of live PerfPanel instances instead of a binding in the status pill: the island and the drawer both host the panel, and a bool with two writers would let one clear it under the other. Clipboard reads cliphist when its page opens: search, copy on click or Enter, delete per row, clear all behind a 3 second confirm, image entries as thumbnails decoded once onto tmpfs. Entries reach sh as $1, never inside a command string. A copy closes the drawer through a new Page.dismiss signal the drawer connects like back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/Drawer.qml')
-rw-r--r--desktop/Drawer.qml69
1 files changed, 48 insertions, 21 deletions
diff --git a/desktop/Drawer.qml b/desktop/Drawer.qml
index 31067f8..4285506 100644
--- a/desktop/Drawer.qml
+++ b/desktop/Drawer.qml
@@ -153,34 +153,58 @@ Scope {
NotificationList {
id: notifications
anchors { top: parent.top; left: parent.left; right: parent.right }
- anchors.bottom: grid.top
+ anchors.bottom: tiles.top
anchors.bottomMargin: 16
onHistory: root.history = true
}
- // Fixed, never scrolled. Three columns at 600px with a
- // 180px minimum; tiles wrap and add rows, ceiling 3x3.
- Flow {
- id: grid
+ // At most three rows tall; more tiles scroll inside
+ // this box, so the notification space above never
+ // shrinks when a module is added.
+ Flickable {
+ id: tiles
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
- spacing: 10
-
- Repeater {
- model: root.modules
-
- Tile {
- required property QtObject modelData
- // Three columns, or fewer if the panel is
- // narrower than three 180px tiles allow.
- width: (grid.width - 2 * grid.spacing) / 3
- icon: modelData.icon
- label: modelData.label
- active: modelData.active
- content: modelData.tileContent
- onClicked: root.activate(modelData)
+ readonly property int maxRows: 3
+ height: Math.min(grid.height, maxRows * 96 + (maxRows - 1) * grid.spacing)
+ contentHeight: grid.height
+ clip: true
+ boundsBehavior: Flickable.StopAtBounds
+
+ Flow {
+ id: grid
+ width: tiles.width
+ spacing: 10
+
+ Repeater {
+ model: root.modules
+
+ Tile {
+ required property QtObject modelData
+ // Three columns, or fewer if the panel is
+ // narrower than three 180px tiles allow.
+ width: (grid.width - 2 * grid.spacing) / 3
+ icon: modelData.icon
+ label: modelData.label
+ active: modelData.active
+ content: modelData.tileContent
+ onClicked: root.activate(modelData)
+ }
}
}
}
+
+ // A thin bar in the panel margin, there only when a row
+ // is hidden, so the fourth row is discoverable. Outside
+ // the Flickable, whose clip would hide it.
+ Rectangle {
+ visible: tiles.contentHeight > tiles.height
+ anchors { left: tiles.right; leftMargin: 6 }
+ y: tiles.y + tiles.visibleArea.yPosition * tiles.height
+ width: 3
+ height: tiles.visibleArea.heightRatio * tiles.height
+ radius: 1.5
+ color: Qt.alpha(Theme.accent, 0.6)
+ }
}
// --- page view ---
@@ -195,7 +219,10 @@ Scope {
// The Page's back arrow returns to the grid. Without this
// the header button is inert, since the page only emits
// `back` and does not know who hosts it.
- onLoaded: if (item && item.back) item.back.connect(() => root.page = "")
+ onLoaded: {
+ if (item && item.back) item.back.connect(() => root.page = "");
+ if (item && item.dismiss) item.dismiss.connect(root.close);
+ }
// The page header shows the module's tile glyph. A Binding,
// not an assignment in onLoaded, so a module whose icon