Merge remote-tracking branch 'origin/staged' into dev

This commit is contained in:
YiFang Xiao 2023-09-14 09:30:52 +08:00
commit 920b0e1c4b
2 changed files with 4 additions and 8 deletions

View file

@ -233,12 +233,12 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
// translate box
groupListInToolbar = new GroupComboBox( navToolbar );
groupListInToolbar->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
groupListInToolbar->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::MinimumExpanding );
groupListInToolbar->setSizeAdjustPolicy( QComboBox::AdjustToContents );
translateBoxLayout->addWidget( groupListInToolbar );
translateBox = new TranslateBox( navToolbar );
translateBox->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
translateBox->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
translateBoxLayout->addWidget( translateBox );
translateBoxToolBarAction = navToolbar->addWidget( translateBoxWidget );
@ -2591,12 +2591,6 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev )
}
return false;
}
if ( ev->type() == QEvent::Resize ) {
QResizeEvent * resizeEvent = static_cast< QResizeEvent * >( ev );
groupList->setFixedHeight( resizeEvent->size().height() );
return false;
}
}
else if ( obj == ui.wordList ) {
if ( ev->type() == QEvent::KeyPress ) {

View file

@ -101,6 +101,8 @@ void TranslateBox::setModel( QStringList & _words )
model->setStringList( _words );
completer->popup()->scrollToTop();
connect( completer,
QOverload< const QString & >::of( &QCompleter::activated ),
translate_line,