aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/qtmaildir/ColourPick.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-17 11:15:41 +0200
committerDanilo M. <danix@danix.xyz>2026-10-17 11:15:41 +0200
commit1eb081419dd24335b39c10166dec598fffab8406 (patch)
tree555260136bf736cc8273827527372d43a1063bd8 /desktop/modules/qtmaildir/ColourPick.qml
parent6d78f47d310f69242a88c4e279b49a659d378066 (diff)
downloadquickshell-1eb081419dd24335b39c10166dec598fffab8406.tar.gz
quickshell-1eb081419dd24335b39c10166dec598fffab8406.zip
qtmaildir settings: the colour dialog follows the desktop's dark style
QtQuick.Dialogs' ColorDialog opened light on the dark desktop. It paints from the Qt Quick palette, which qt6ct leaves at Qt's default here: its custom_palette is off and the dark comes from the kvantum-dark widget style, which Qt Quick does not use. Qt.labs.platform's ColorDialog falls back to the widget QColorDialog in a QApplication, which this process already is for the tray menus, and widgets take the kvantum style like every other application. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/qtmaildir/ColourPick.qml')
-rw-r--r--desktop/modules/qtmaildir/ColourPick.qml19
1 files changed, 13 insertions, 6 deletions
diff --git a/desktop/modules/qtmaildir/ColourPick.qml b/desktop/modules/qtmaildir/ColourPick.qml
index 96933a9..12c6f70 100644
--- a/desktop/modules/qtmaildir/ColourPick.qml
+++ b/desktop/modules/qtmaildir/ColourPick.qml
@@ -10,11 +10,18 @@
// GNU General Public License for more details.
import QtQuick
-import QtQuick.Dialogs
+import Qt.labs.platform as P
import "../.."
-// A swatch of the current colour that opens the platform's colour dialog.
-// picked carries the choice as #rrggbb, the form qtmaildir.conf uses.
+// A swatch of the current colour that opens a colour dialog. picked carries
+// the choice as #rrggbb, the form qtmaildir.conf uses.
+//
+// Qt.labs.platform, not QtQuick.Dialogs: the Quick dialog paints from the
+// Qt Quick palette, which qt6ct leaves at Qt's light default here
+// (custom_palette=false; the dark comes from the kvantum-dark widget style),
+// so it opened light on a dark desktop. This one falls back to the widget
+// QColorDialog in a QApplication, which shell.qml's UseQApplication pragma
+// makes this process, and widgets take the kvantum style like every app.
Rectangle {
id: pick
property string colour: ""
@@ -43,11 +50,11 @@ Rectangle {
onClicked: dialog.open()
}
- ColorDialog {
+ P.ColorDialog {
id: dialog
- selectedColor: /^#[0-9a-fA-F]{6}$/.test(pick.colour) ? pick.colour : "#808080"
+ currentColor: /^#[0-9a-fA-F]{6}$/.test(pick.colour) ? pick.colour : "#808080"
// toString() is #rrggbb for an opaque colour, and the dialog offers
// no alpha unless asked to; the slice is a guard all the same.
- onAccepted: pick.picked(selectedColor.toString().slice(0, 7))
+ onAccepted: pick.picked(color.toString().slice(0, 7))
}
}