diff options
Diffstat (limited to 'desktop/modules/qtmaildir/ColourPick.qml')
| -rw-r--r-- | desktop/modules/qtmaildir/ColourPick.qml | 19 |
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)) } } |
