diff --git a/scanpopup.cc b/scanpopup.cc index be5f6441..ba0f614b 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -847,15 +847,29 @@ void ScanPopup::typingEvent( QString const & t ) bool ScanPopup::eventFilter( QObject * watched, QEvent * event ) { - if ( event->type() == QEvent::FocusIn && watched == ui.translateBox->translateLine() ) + if ( watched == ui.translateBox->translateLine() ) { - QFocusEvent * focusEvent = static_cast< QFocusEvent * >( event ); + if ( event->type() == QEvent::FocusIn ) + { + QFocusEvent * focusEvent = static_cast< QFocusEvent * >( event ); - // select all on mouse click - if ( focusEvent->reason() == Qt::MouseFocusReason ) { - QTimer::singleShot(0, this, SLOT(focusTranslateLine())); + // select all on mouse click + if ( focusEvent->reason() == Qt::MouseFocusReason ) { + QTimer::singleShot(0, this, SLOT(focusTranslateLine())); + } + return false; + } + + if ( event->type() == QEvent::Resize ) + { + // The UI looks ugly when group combobox is higher than translate line. + // Make the height of the combobox the same as the line edit's height. + // The fonts of these UI items should be kept in sync by applyWordsZoomLevel() + // so that text in the combobox is not clipped. + const QResizeEvent * const resizeEvent = static_cast< const QResizeEvent * >( event ); + ui.groupList->setFixedHeight( resizeEvent->size().height() ); + return false; } - return false; } if ( mouseIntercepted ) diff --git a/scanpopup.ui b/scanpopup.ui index 4d48b12a..a9dd1c58 100644 --- a/scanpopup.ui +++ b/scanpopup.ui @@ -83,7 +83,7 @@ - + 0 0