Skip to content

Commit

Permalink
Fixed bug where window would not be maximized when returning from ful…
Browse files Browse the repository at this point in the history
…lscreen if it was maximized before
  • Loading branch information
ripose committed Feb 4, 2021
1 parent 4cd403f commit 4aedf74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
#include <QThreadPool>

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),
m_ui(new Ui::MainWindow)
m_ui(new Ui::MainWindow),
m_maximized(false)
{
m_ui->setupUi(this);

Expand Down Expand Up @@ -205,6 +206,7 @@ void MainWindow::setFullscreen(bool value)
{
if (value)
{
m_maximized = isMaximized();
showFullScreen();
m_ui->m_menubar->hide();
QApplication::processEvents();
Expand All @@ -214,7 +216,10 @@ void MainWindow::setFullscreen(bool value)
}
else
{
showNormal();
if (m_maximized)
showMaximized();
else
showNormal();
m_ui->m_menubar->show();
m_ui->m_controls->show();
m_ui->m_centralwidget->layout()->addWidget(m_ui->m_controls);
Expand Down
1 change: 1 addition & 0 deletions src/gui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private Q_SLOTS:
DefinitionWidget *m_definition;
AnkiSettings *m_ankiSettings;
AnkiClient *m_ankiClient;
bool m_maximized;

void clearTracks();
void clearTrack(
Expand Down

0 comments on commit 4aedf74

Please sign in to comment.