Commit c7d2b22c authored by Ivan Yossi's avatar Ivan Yossi 👌

Use loaded color colorSpace for QColor transformations

toQColor uses current Color colorSpace to convert which avoids the color
discrepancy after hitting ok on nativeDialog in macOS.

BUG:407880
parent f6e67d22
...@@ -347,8 +347,12 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event ) ...@@ -347,8 +347,12 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event )
d->colorSelectorDialog->setPreviousColor(d->foregroundColor); d->colorSelectorDialog->setPreviousColor(d->foregroundColor);
//this should toggle, but I don't know how to implement that... //this should toggle, but I don't know how to implement that...
d->colorSelectorDialog->show(); d->colorSelectorDialog->show();
#else
#ifdef Q_OS_MACOS
QColor c = d->foregroundColor.toQColor();
#else #else
QColor c = d->displayRenderer->toQColor(d->foregroundColor); QColor c = d->displayRenderer->toQColor(d->foregroundColor);
#endif
c = QColorDialog::getColor(c, this); c = QColorDialog::getColor(c, this);
if (c.isValid()) { if (c.isValid()) {
d->foregroundColor = d->displayRenderer->approximateFromRenderedQColor(c); d->foregroundColor = d->displayRenderer->approximateFromRenderedQColor(c);
...@@ -372,8 +376,12 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event ) ...@@ -372,8 +376,12 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event )
c = KisDlgInternalColorSelector::getModalColorDialog(c, this); c = KisDlgInternalColorSelector::getModalColorDialog(c, this);
d->backgroundColor = c; d->backgroundColor = c;
emit backgroundColorChanged(d->backgroundColor); emit backgroundColorChanged(d->backgroundColor);
#else
#ifdef Q_OS_MACOS
QColor c = d->backgroundColor.toQColor();
#else #else
QColor c = d->displayRenderer->toQColor(d->backgroundColor); QColor c = d->displayRenderer->toQColor(d->backgroundColor);
#endif
c = QColorDialog::getColor(c, this); c = QColorDialog::getColor(c, this);
if (c.isValid()) { if (c.isValid()) {
d->backgroundColor = d->displayRenderer->approximateFromRenderedQColor(c); d->backgroundColor = d->displayRenderer->approximateFromRenderedQColor(c);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment