From 2b9c732f0515bf0f6bb7444e10faddfd1ff4e485 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 30 Nov 2026 17:49:01 +0100 Subject: 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 --- desktop/SectionHeader.qml | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 desktop/SectionHeader.qml (limited to 'desktop/SectionHeader.qml') 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. +// +// 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 + } +} -- cgit v1.2.3