Skip to content

Commit

Permalink
Fix escape and enter don't work to close color or symbol selector dia…
Browse files Browse the repository at this point in the history
…logs

Fixes #27602
  • Loading branch information
nyalldawson committed Dec 11, 2019
1 parent e2e1bd3 commit 2e25151
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/qgscolordialog.cpp
Expand Up @@ -42,6 +42,8 @@ QgsColorDialog::QgsColorDialog( QWidget *parent, Qt::WindowFlags fl, const QColo
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsColorDialog::mButtonBox_rejected );
connect( mButtonBox, &QDialogButtonBox::clicked, this, &QgsColorDialog::mButtonBox_clicked );

connect( mColorWidget, &QgsPanelWidget::panelAccepted, this, &QDialog::reject );

if ( mPreviousColor.isValid() )
{
QPushButton *resetButton = new QPushButton( tr( "Reset" ) );
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgspanelwidget.cpp
Expand Up @@ -105,6 +105,10 @@ void QgsPanelWidget::keyPressEvent( QKeyEvent *event )
{
acceptPanel();
}
else
{
QWidget::keyPressEvent( event );
}
}

QgsPanelWidgetWrapper::QgsPanelWidgetWrapper( QWidget *widget, QWidget *parent )
Expand Down
2 changes: 2 additions & 0 deletions src/gui/symbology/qgssymbolselectordialog.cpp
Expand Up @@ -782,6 +782,8 @@ QgsSymbolSelectorDialog::QgsSymbolSelectorDialog( QgsSymbol *symbol, QgsStyle *s
layout()->addWidget( mSelectorWidget );
layout()->addWidget( mButtonBox );

connect( mSelectorWidget, &QgsPanelWidget::panelAccepted, this, &QDialog::reject );

mSelectorWidget->setMinimumSize( 460, 560 );
setObjectName( QStringLiteral( "SymbolSelectorDialog" ) );
QgsGui::instance()->enableAutoGeometryRestore( this );
Expand Down

0 comments on commit 2e25151

Please sign in to comment.