Skip to content
Permalink
Browse files

Fix escape and enter don't work to close color or symbol selector dia…

…logs

Fixes #27602

(cherry picked from commit 2e25151)
  • Loading branch information
nyalldawson committed Dec 11, 2019
1 parent e76654b commit be563c107fdb2d72178709ba94842f50be475fc4
Showing with 8 additions and 0 deletions.
  1. +2 −0 src/gui/qgscolordialog.cpp
  2. +4 −0 src/gui/qgspanelwidget.cpp
  3. +2 −0 src/gui/symbology/qgssymbolselectordialog.cpp
@@ -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" ) );
@@ -105,6 +105,10 @@ void QgsPanelWidget::keyPressEvent( QKeyEvent *event )
{
acceptPanel();
}
else
{
QWidget::keyPressEvent( event );
}
}

QgsPanelWidgetWrapper::QgsPanelWidgetWrapper( QWidget *widget, QWidget *parent )
@@ -776,6 +776,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 );

0 comments on commit be563c1

Please sign in to comment.
You can’t perform that action at this time.