aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-30 17:49:01 +0100
committerDanilo M. <danix@danix.xyz>2026-11-30 17:49:01 +0100
commit2b9c732f0515bf0f6bb7444e10faddfd1ff4e485 (patch)
tree98741e0a77391ecdc543ecd688608c67df182a27
parentbed24e616e0cb4c4adb75b0bf8693f62670880b5 (diff)
downloadquickshell-2b9c732f0515bf0f6bb7444e10faddfd1ff4e485.tar.gz
quickshell-2b9c732f0515bf0f6bb7444e10faddfd1ff4e485.zip
feat(drawer): one section header across the drawer pages
The drawer pages divided their sections with subtext-coloured titles at fontSize - 2 and 1px lines at 0.12 alpha, and the sections ran together. desktop/SectionHeader.qml is the one title now: an accent glyph, a bold label one size up, and a divider at 0.3 with space above it, off for a page's first section. Children sit on the right, anchored to the bottom where the label is, so the Bluetooth and Wi-Fi switches and the sound level/mute control ride in the header. Sound, Bluetooth, Mail, Services and AI use it. Mail had no titles: the unread total moves into an Accounts header, and its first divider becomes a Watcher header. Services drops its import of ../qtmaildir, which was only there for Heading; Heading stays as the settings window's title and is untouched. Every glyph was checked in Inconsolata Nerd Font's cmap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rw-r--r--desktop/SectionHeader.qml49
-rw-r--r--desktop/modules/ai/AiPage.qml16
-rw-r--r--desktop/modules/bluetooth/BluetoothPage.qml42
-rw-r--r--desktop/modules/mail/MailPage.qml14
-rw-r--r--desktop/modules/services/ServicesPage.qml7
-rw-r--r--desktop/modules/sound/SoundPage.qml23
6 files changed, 75 insertions, 76 deletions
diff --git a/desktop/SectionHeader.qml b/desktop/SectionHeader.qml
new file mode 100644
index 0000000..6bbe07a
--- /dev/null
+++ b/desktop/SectionHeader.qml
@@ -0,0 +1,49 @@
+// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+import QtQuick
+
+// A drawer page's section title: accent glyph, bold label, and a divider
+// with space above it, which is what separates the sections. The divider is
+// at 0.3: the 0.12 one the pages used before read too faint. The first
+// section of a page sets divider: false. Children (a switch, a level) are
+// laid on the right; anchor them to the bottom, where the label sits.
+Item {
+ property string glyph
+ property string label
+ property bool divider: true
+
+ width: parent ? parent.width : 0
+ implicitHeight: headerText.implicitHeight + (divider ? 18 : 10)
+
+ Rectangle {
+ visible: parent.divider
+ width: parent.width
+ height: 1
+ color: Qt.alpha(Theme.text, 0.3)
+ }
+
+ Text {
+ id: headerGlyph
+ anchors { left: parent.left; verticalCenter: headerText.verticalCenter }
+ text: parent.glyph
+ font { family: Theme.iconFamily; pixelSize: Theme.fontSize }
+ color: Theme.accent
+ }
+
+ Text {
+ id: headerText
+ anchors { left: headerGlyph.right; leftMargin: 8; bottom: parent.bottom }
+ text: parent.label
+ font { family: Theme.fontFamily; pixelSize: Theme.fontSize + 1; bold: true }
+ color: Theme.text
+ }
+}
diff --git a/desktop/modules/ai/AiPage.qml b/desktop/modules/ai/AiPage.qml
index c1cb07c..fed9e65 100644
--- a/desktop/modules/ai/AiPage.qml
+++ b/desktop/modules/ai/AiPage.qml
@@ -21,12 +21,7 @@ Column {
spacing: 8
- Text {
- width: page.width
- text: "Engines"
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true }
- color: Theme.subtext
- }
+ SectionHeader { divider: false; glyph: "\uf2db"; label: "Engines" }
Repeater {
model: page.ai.engines
@@ -48,14 +43,7 @@ Column {
}
}
- Item { width: 1; height: 6 }
-
- Text {
- width: page.width
- text: "Apps"
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true }
- color: Theme.subtext
- }
+ SectionHeader { glyph: String.fromCodePoint(0xF003B); label: "Apps" }
Repeater {
model: page.ai.apps
diff --git a/desktop/modules/bluetooth/BluetoothPage.qml b/desktop/modules/bluetooth/BluetoothPage.qml
index 8ab67f0..a289205 100644
--- a/desktop/modules/bluetooth/BluetoothPage.qml
+++ b/desktop/modules/bluetooth/BluetoothPage.qml
@@ -22,21 +22,13 @@ Column {
// --- Adapter ---
- Item {
- width: page.width
- implicitHeight: Math.max(btLabel.implicitHeight, powerSwitch.implicitHeight)
-
- Text {
- id: btLabel
- anchors.verticalCenter: parent.verticalCenter
- text: "Bluetooth"
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 1; bold: true }
- color: Theme.text
- }
+ SectionHeader {
+ divider: false
+ glyph: "\uf293"
+ label: "Bluetooth"
Switch {
- id: powerSwitch
- anchors { right: parent.right; verticalCenter: parent.verticalCenter }
+ anchors { right: parent.right; bottom: parent.bottom }
enabled: page.bt.adapter !== null
checked: page.bt.adapter ? page.bt.adapter.enabled : false
onToggled: on => { if (page.bt.adapter) page.bt.adapter.enabled = on; }
@@ -97,13 +89,7 @@ Column {
// --- Connected ---
- Text {
- width: page.width
- visible: page.bt.connectedDevices.length > 0
- text: "Connected"
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true }
- color: Theme.subtext
- }
+ SectionHeader { visible: page.bt.connectedDevices.length > 0; glyph: "\uf0c1"; label: "Connected" }
Repeater {
model: page.bt.connectedDevices
@@ -118,13 +104,7 @@ Column {
// --- Paired ---
- Text {
- width: page.width
- visible: page.bt.pairedDevices.length > 0
- text: "Paired"
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true }
- color: Theme.subtext
- }
+ SectionHeader { visible: page.bt.pairedDevices.length > 0; glyph: String.fromCodePoint(0xF1218); label: "Paired" }
Repeater {
model: page.bt.pairedDevices
@@ -139,13 +119,7 @@ Column {
// --- Available (found while scanning, not yet paired) ---
- Text {
- width: page.width
- visible: page.bt.availableDevices.length > 0
- text: "Available"
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true }
- color: Theme.subtext
- }
+ SectionHeader { visible: page.bt.availableDevices.length > 0; glyph: "\uf002"; label: "Available" }
Repeater {
model: page.bt.availableDevices
diff --git a/desktop/modules/mail/MailPage.qml b/desktop/modules/mail/MailPage.qml
index 1b41412..03ce71a 100644
--- a/desktop/modules/mail/MailPage.qml
+++ b/desktop/modules/mail/MailPage.qml
@@ -67,13 +67,13 @@ Column {
onLoadFailed: page.readHeartbeat("")
}
- Item {
- width: parent.width
- implicitHeight: totalText.implicitHeight
+ SectionHeader {
+ divider: false
+ glyph: "\uf0e0"
+ label: "Accounts"
Text {
- id: totalText
- anchors.right: parent.right
+ anchors { right: parent.right; bottom: parent.bottom }
// A dash rather than a possibly-wrong number while any account is
// still unknown.
text: Accounts.anyUnknown ? "—" : `${Accounts.total} unread`
@@ -195,7 +195,7 @@ Column {
}
}
- Rectangle { width: parent.width; height: 1; color: Qt.alpha(Theme.text, 0.12) }
+ SectionHeader { glyph: "\uf21e"; label: "Watcher" }
// Watcher health. Green when idling, yellow when a folder gave up, red
// when there is no fresh heartbeat at all.
@@ -219,7 +219,7 @@ Column {
}
}
- Rectangle { width: parent.width; height: 1; color: Qt.alpha(Theme.text, 0.12) }
+ Rectangle { width: parent.width; height: 1; color: Qt.alpha(Theme.text, 0.3) }
Row {
anchors.right: parent.right
diff --git a/desktop/modules/services/ServicesPage.qml b/desktop/modules/services/ServicesPage.qml
index cc392db..652f9da 100644
--- a/desktop/modules/services/ServicesPage.qml
+++ b/desktop/modules/services/ServicesPage.qml
@@ -13,7 +13,6 @@ import QtQuick
import "../.."
import "../ai"
import "../deckit"
-import "../qtmaildir"
// Shells, deck-it and the daemons, one row each: Start when stopped, Stop and
// Restart when running. The desktop shell has no Stop: it draws this page.
@@ -27,7 +26,7 @@ Column {
Component.onCompleted: { page.services.watchers++; DeckIt.watchers++; page.services.refresh(); }
Component.onDestruction: { page.services.watchers--; DeckIt.watchers--; }
- Heading { text: "Shells" }
+ SectionHeader { divider: false; glyph: "\uf120"; label: "Shells" }
AiRow {
width: page.width
@@ -57,7 +56,7 @@ Column {
}
}
- Heading { text: "deck-it" }
+ SectionHeader { glyph: String.fromCodePoint(0xF0ECE); label: "deck-it" }
AiRow {
width: page.width
@@ -71,7 +70,7 @@ Column {
onRestart: DeckIt.control("restart")
}
- Heading { text: "Daemons" }
+ SectionHeader { glyph: "\uf085"; label: "Daemons" }
Repeater {
model: page.services.daemons
diff --git a/desktop/modules/sound/SoundPage.qml b/desktop/modules/sound/SoundPage.qml
index 3f39c48..f220b61 100644
--- a/desktop/modules/sound/SoundPage.qml
+++ b/desktop/modules/sound/SoundPage.qml
@@ -128,22 +128,15 @@ Column {
width: page.width
spacing: 6
- Item {
- width: parent.width
- implicitHeight: name.implicitHeight
-
- Text {
- id: name
- anchors.left: parent.left
- text: modelData.label
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 1; bold: true }
- color: Theme.text
- }
+ SectionHeader {
+ divider: modelData.label !== "Output"
+ glyph: String.fromCodePoint(modelData.label === "Output" ? 0xF04C3 : 0xF036C)
+ label: modelData.label
// State glyph and level, clickable to mute/unmute.
Row {
id: levelRow
- anchors { right: parent.right; verticalCenter: parent.verticalCenter }
+ anchors { right: parent.right; bottom: parent.bottom }
spacing: 6
Text {
@@ -269,11 +262,7 @@ Column {
spacing: 10
visible: page.service.streams.length > 0
- Text {
- text: "Applications"
- font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 1; bold: true }
- color: Theme.text
- }
+ SectionHeader { glyph: String.fromCodePoint(0xF003B); label: "Applications" }
Repeater {
model: page.service.streams