QmlDesigner: Fix for ColorEditors Pickers Canvas

Task-number: QDS-12714
Change-Id: Ie8a6b8be88f4f020cbc82f66015dc7db76d14f56
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
(cherry picked from commit 11802e70d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Aleksei German
2024-05-07 16:52:30 +02:00
parent 3a3474a4c0
commit 0c4eab7f87
3 changed files with 21 additions and 0 deletions

View File

@@ -223,7 +223,10 @@ SecondColumnLayout {
function open() {
popupDialog.ensureLoader()
popupDialog.show(preview)
popupDialog.loaderItem.aboutToBeShown() //need it for now
}
function determineActiveColorMode() {

View File

@@ -12,6 +12,12 @@ import QtQuickDesignerColorPalette
Column {
id: root
// There seems to be an issue on Windows and MacOS with ColorPickers
// Canvases not being painted on initialization
// because ColorEditorPopup is invisible at init time,
// so we use this signal to explicitly pass visibility status
signal aboutToBeShown
property bool eyeDropperActive: ColorPaletteBackend.eyeDropperActive
property bool supportGradient: false
@@ -433,6 +439,13 @@ Column {
hsvValueSpinBox.value = colorPicker.value
hsvAlphaSpinBox.value = colorPicker.alpha
}
Connections {
target: root
onAboutToBeShown: {
colorPicker.aboutToBeShown()
}
}
}
Column {

View File

@@ -13,6 +13,8 @@ Column {
HSLA
}
signal aboutToBeShown
property int mode: ColorPicker.Mode.HSVA
property color color: "#303091"
@@ -206,6 +208,8 @@ Column {
target: root
function onHueChanged() { gradientOverlay.requestPaint() }
function onModeChanged() { gradientOverlay.requestPaint() }
function onAlphaChanged() { gradientOverlay.requestPaint() }
function onAboutToBeShown() { gradientOverlay.requestPaint() }
}
onPaint: {
@@ -249,6 +253,7 @@ Column {
function onColorInvalidated() { pickerCross.requestPaint() }
function onColorChanged() { pickerCross.requestPaint() }
function onModeChanged() { pickerCross.requestPaint() }
function onAboutToBeShown() { pickerCross.requestPaint() }
}
onPaint: {