mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Do nothing if color dialog is closed using Escape button
This commit is contained in:
parent
719feac15e
commit
f981cf2ce0
@ -121,11 +121,14 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
|
|||||||
&QPushButton::clicked,
|
&QPushButton::clicked,
|
||||||
[this, variableValueMap, variableName, theme, editor, widget, colorBox]() -> void {
|
[this, variableValueMap, variableName, theme, editor, widget, colorBox]() -> void {
|
||||||
QColor color = QColorDialog::getColor( colorBox->palette().color( QPalette::Button ), widget );
|
QColor color = QColorDialog::getColor( colorBox->palette().color( QPalette::Button ), widget );
|
||||||
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( color.name() ) );
|
if ( color.isValid() )
|
||||||
colorBox->style()->unpolish( colorBox );
|
{
|
||||||
colorBox->style()->polish( colorBox );
|
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( color.name() ) );
|
||||||
RiuGuiTheme::changeVariableValue( theme, variableName, color.name() );
|
colorBox->style()->unpolish( colorBox );
|
||||||
editor->setPlainText( RiuGuiTheme::applyVariableValueMapToStyleSheet( theme ) );
|
colorBox->style()->polish( colorBox );
|
||||||
|
RiuGuiTheme::changeVariableValue( theme, variableName, color.name() );
|
||||||
|
editor->setPlainText( RiuGuiTheme::applyVariableValueMapToStyleSheet( theme ) );
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
innerLayout->addWidget( colorBox, row++, column + 1 );
|
innerLayout->addWidget( colorBox, row++, column + 1 );
|
||||||
if ( row == 10 )
|
if ( row == 10 )
|
||||||
|
Loading…
Reference in New Issue
Block a user