From 1eb081419dd24335b39c10166dec598fffab8406 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 17 Oct 2026 11:15:41 +0200 Subject: 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 --- desktop/modules/qtmaildir/ColourPick.qml | 19 +++++++++++++------ 1 file 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)) } } -- cgit v1.2.3