remember is window was maximised before fullscreen
This commit is contained in:
parent
cfbb4152c3
commit
5f9211f98f
2 changed files with 7 additions and 1 deletions
|
@ -36,7 +36,12 @@ void MainWindow::setupWebView() {
|
||||||
void MainWindow::fullScreenRequested(
|
void MainWindow::fullScreenRequested(
|
||||||
QWebEngineFullScreenRequest fullScreenRequest) {
|
QWebEngineFullScreenRequest fullScreenRequest) {
|
||||||
fullScreenRequest.accept();
|
fullScreenRequest.accept();
|
||||||
fullScreenRequest.toggleOn() ? showFullScreen() : showNormal();
|
if (fullScreenRequest.toggleOn()) {
|
||||||
|
m_wasMaximized = isMaximized();
|
||||||
|
showFullScreen();
|
||||||
|
} else {
|
||||||
|
m_wasMaximized ? showMaximized() : showNormal();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *event) { QApplication::quit(); }
|
void MainWindow::closeEvent(QCloseEvent *event) { QApplication::quit(); }
|
||||||
|
|
|
@ -22,6 +22,7 @@ private:
|
||||||
QWebEngineProfile *prepareProfile();
|
QWebEngineProfile *prepareProfile();
|
||||||
DiscordPage *m_discordPage;
|
DiscordPage *m_discordPage;
|
||||||
void closeEvent(QCloseEvent *event) override;
|
void closeEvent(QCloseEvent *event) override;
|
||||||
|
bool m_wasMaximized;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
|
void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
|
||||||
|
|
Loading…
Reference in a new issue