aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/SectionHeader.qml
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 /desktop/SectionHeader.qml
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>
Diffstat (limited to 'desktop/SectionHeader.qml')
-rw-r--r--desktop/SectionHeader.qml49
1 files changed, 49 insertions, 0 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
+ }
+}