aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/qtmaildir/Setting.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-17 11:13:43 +0200
committerDanilo M. <danix@danix.xyz>2026-10-17 11:13:43 +0200
commit6d78f47d310f69242a88c4e279b49a659d378066 (patch)
tree575427a3cb3ee07968682a9ff81af28d77d75de3 /desktop/modules/qtmaildir/Setting.qml
parentc6fc5bbef45bcfa4f8d5e50ca7401aa1f5b6bc7d (diff)
downloadquickshell-6d78f47d310f69242a88c4e279b49a659d378066.tar.gz
quickshell-6d78f47d310f69242a88c4e279b49a659d378066.zip
qtmaildir settings: a colour picker for colour fields
An account's chip colour and each tag colour were #rrggbb typed by hand. A swatch beside each now shows the colour and opens Qt's own ColorDialog, which writes the choice back as #rrggbb; typing still works. The add-tag row has one too, filling its field. Setting.qml gains a colour flag rather than a second component, since a colour key is an ordinary text key with a swatch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/qtmaildir/Setting.qml')
-rw-r--r--desktop/modules/qtmaildir/Setting.qml13
1 files changed, 12 insertions, 1 deletions
diff --git a/desktop/modules/qtmaildir/Setting.qml b/desktop/modules/qtmaildir/Setting.qml
index 59e9c1b..66d0a46 100644
--- a/desktop/modules/qtmaildir/Setting.qml
+++ b/desktop/modules/qtmaildir/Setting.qml
@@ -26,6 +26,8 @@ Column {
property string kind: "text"
property real min: -Infinity
property real max: Infinity
+ // A #rrggbb key: a swatch beside the field opens a colour dialog.
+ property bool colour: false
// What a search hit scrolls to.
objectName: section + "/" + key
width: parent ? parent.width : 0
@@ -61,8 +63,17 @@ Column {
color: Theme.subtext
font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 }
}
+ ColourPick {
+ id: pick
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
+ visible: s.colour
+ width: s.colour ? 34 : 0
+ colour: s.value
+ onPicked: hex => s.commit(hex)
+ }
Rectangle {
- anchors { left: lbl.right; leftMargin: 8; right: parent.right; top: parent.top; bottom: parent.bottom }
+ anchors { left: lbl.right; leftMargin: 8; right: pick.left; rightMargin: s.colour ? 8 : 0
+ top: parent.top; bottom: parent.bottom }
radius: 8
color: Theme.surface
TextInput {