Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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 )
d->colorSelectorDialog->setPreviousColor(d->foregroundColor);
//this should toggle, but I don't know how to implement that...
d->colorSelectorDialog->show();
#else
#ifdef Q_OS_MACOS
QColor c = d->foregroundColor.toQColor();
#else
QColor c = d->displayRenderer->toQColor(d->foregroundColor);
#endif
c = QColorDialog::getColor(c, this);
if (c.isValid()) {
d->foregroundColor = d->displayRenderer->approximateFromRenderedQColor(c);
......@@ -372,8 +376,12 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event )
c = KisDlgInternalColorSelector::getModalColorDialog(c, this);
d->backgroundColor = c;
emit backgroundColorChanged(d->backgroundColor);
#else
#ifdef Q_OS_MACOS
QColor c = d->backgroundColor.toQColor();
#else
QColor c = d->displayRenderer->toQColor(d->backgroundColor);
#endif
c = QColorDialog::getColor(c, this);
if (c.isValid()) {
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