mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
opt: remove wasMaximized logic of mainwindow
This commit is contained in:
parent
296251afad
commit
99c221c854
|
@ -165,7 +165,6 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
audioPlayerFactory( cfg.preferences ),
|
||||
wordFinder( this ),
|
||||
wordListSelChanged( false ),
|
||||
wasMaximized( false ),
|
||||
headwordsDlg( nullptr ),
|
||||
ftsIndexing( dictionaries ),
|
||||
ftsDlg( nullptr ),
|
||||
|
@ -872,8 +871,6 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
mainStatusBar->showMessage( tr( "Accessibility API is not enabled" ), 10000, QPixmap( ":/icons/error.svg" ) );
|
||||
#endif
|
||||
|
||||
wasMaximized = isMaximized();
|
||||
|
||||
history.setSaveInterval( cfg.preferences.historyStoreInterval );
|
||||
#ifndef Q_OS_MACOS
|
||||
ui.centralWidget->grabGesture( Gestures::GDPinchGestureType );
|
||||
|
@ -2482,11 +2479,6 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev )
|
|||
}
|
||||
}
|
||||
|
||||
if ( obj == this && ev->type() == QEvent::WindowStateChange ) {
|
||||
auto stev = dynamic_cast< QWindowStateChangeEvent * >( ev );
|
||||
wasMaximized = ( stev->oldState() == Qt::WindowMaximized && isMinimized() );
|
||||
}
|
||||
|
||||
if ( ev->type() == QEvent::MouseButtonPress ) {
|
||||
auto event = dynamic_cast< QMouseEvent * >( ev );
|
||||
|
||||
|
@ -2744,15 +2736,6 @@ void MainWindow::toggleMainWindow( bool onlyShow )
|
|||
raise();
|
||||
shown = true;
|
||||
}
|
||||
else if ( isMinimized() ) {
|
||||
if ( wasMaximized )
|
||||
showMaximized();
|
||||
else
|
||||
showNormal();
|
||||
activateWindow();
|
||||
raise();
|
||||
shown = true;
|
||||
}
|
||||
else if ( !isActiveWindow() ) {
|
||||
activateWindow();
|
||||
if ( cfg.preferences.raiseWindowOnSearch ) {
|
||||
|
|
|
@ -158,8 +158,6 @@ private:
|
|||
|
||||
bool wordListSelChanged;
|
||||
|
||||
bool wasMaximized; // Window state before minimization
|
||||
|
||||
QPrinter & getPrinter(); // Creates a printer if it's not there and returns it
|
||||
|
||||
DictHeadwords * headwordsDlg;
|
||||
|
|
Loading…
Reference in a new issue