clear highlight from selected widgets when cancelling customization

dialog (fix #23199)
This commit is contained in:
Alexander Bruy 2025-02-17 11:56:35 +00:00 committed by Nyall Dawson
parent 17d535c90f
commit 17a27a0887
2 changed files with 10 additions and 0 deletions

View File

@ -272,6 +272,14 @@ void QgsCustomizationDialog::apply()
void QgsCustomizationDialog::cancel()
{
if ( mSelectedWidgets.size() > 0 )
{
for ( int i = 0; i < mSelectedWidgets.size(); i++ )
{
mSelectedWidgets.at( i )->setStyleSheet( "" );
}
mSelectedWidgets.clear();
}
hide();
}
@ -513,6 +521,7 @@ bool QgsCustomizationDialog::switchWidget( QWidget *widget, QMouseEvent *e )
QString style;
if ( !on )
{
mSelectedWidgets.append( widget );
style = QStringLiteral( "background-color: #FFCCCC;" );
}
widget->setStyleSheet( style );

View File

@ -104,6 +104,7 @@ class APP_EXPORT QgsCustomizationDialog : public QMainWindow, private Ui::QgsCus
QString mLastDirSettingsName;
QSettings *mSettings = nullptr;
QList<QWidget *> mSelectedWidgets;
protected:
QMap<QTreeWidgetItem *, bool> mTreeInitialExpand;