Do nothing if color dialog is closed using Escape button

This commit is contained in:
Magne Sjaastad 2020-09-20 12:03:08 +02:00 committed by Gaute Lindkvist
parent 719feac15e
commit f981cf2ce0

View File

@ -121,11 +121,14 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
&QPushButton::clicked,
[this, variableValueMap, variableName, theme, editor, widget, colorBox]() -> void {
QColor color = QColorDialog::getColor( colorBox->palette().color( QPalette::Button ), widget );
if ( color.isValid() )
{
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( color.name() ) );
colorBox->style()->unpolish( colorBox );
colorBox->style()->polish( colorBox );
RiuGuiTheme::changeVariableValue( theme, variableName, color.name() );
editor->setPlainText( RiuGuiTheme::applyVariableValueMapToStyleSheet( theme ) );
}
} );
innerLayout->addWidget( colorBox, row++, column + 1 );
if ( row == 10 )