forked from qt-creator/qt-creator
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:
@@ -223,7 +223,10 @@ SecondColumnLayout {
|
|||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
popupDialog.ensureLoader()
|
popupDialog.ensureLoader()
|
||||||
|
|
||||||
popupDialog.show(preview)
|
popupDialog.show(preview)
|
||||||
|
|
||||||
|
popupDialog.loaderItem.aboutToBeShown() //need it for now
|
||||||
}
|
}
|
||||||
|
|
||||||
function determineActiveColorMode() {
|
function determineActiveColorMode() {
|
||||||
|
@@ -12,6 +12,12 @@ import QtQuickDesignerColorPalette
|
|||||||
Column {
|
Column {
|
||||||
id: root
|
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 eyeDropperActive: ColorPaletteBackend.eyeDropperActive
|
||||||
|
|
||||||
property bool supportGradient: false
|
property bool supportGradient: false
|
||||||
@@ -433,6 +439,13 @@ Column {
|
|||||||
hsvValueSpinBox.value = colorPicker.value
|
hsvValueSpinBox.value = colorPicker.value
|
||||||
hsvAlphaSpinBox.value = colorPicker.alpha
|
hsvAlphaSpinBox.value = colorPicker.alpha
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: root
|
||||||
|
onAboutToBeShown: {
|
||||||
|
colorPicker.aboutToBeShown()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
@@ -13,6 +13,8 @@ Column {
|
|||||||
HSLA
|
HSLA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signal aboutToBeShown
|
||||||
|
|
||||||
property int mode: ColorPicker.Mode.HSVA
|
property int mode: ColorPicker.Mode.HSVA
|
||||||
property color color: "#303091"
|
property color color: "#303091"
|
||||||
|
|
||||||
@@ -206,6 +208,8 @@ Column {
|
|||||||
target: root
|
target: root
|
||||||
function onHueChanged() { gradientOverlay.requestPaint() }
|
function onHueChanged() { gradientOverlay.requestPaint() }
|
||||||
function onModeChanged() { gradientOverlay.requestPaint() }
|
function onModeChanged() { gradientOverlay.requestPaint() }
|
||||||
|
function onAlphaChanged() { gradientOverlay.requestPaint() }
|
||||||
|
function onAboutToBeShown() { gradientOverlay.requestPaint() }
|
||||||
}
|
}
|
||||||
|
|
||||||
onPaint: {
|
onPaint: {
|
||||||
@@ -249,6 +253,7 @@ Column {
|
|||||||
function onColorInvalidated() { pickerCross.requestPaint() }
|
function onColorInvalidated() { pickerCross.requestPaint() }
|
||||||
function onColorChanged() { pickerCross.requestPaint() }
|
function onColorChanged() { pickerCross.requestPaint() }
|
||||||
function onModeChanged() { pickerCross.requestPaint() }
|
function onModeChanged() { pickerCross.requestPaint() }
|
||||||
|
function onAboutToBeShown() { pickerCross.requestPaint() }
|
||||||
}
|
}
|
||||||
|
|
||||||
onPaint: {
|
onPaint: {
|
||||||
|
Reference in New Issue
Block a user