remember is window was maximised before fullscreen
This commit is contained in:
parent
cfbb4152c3
commit
5f9211f98f
|
@ -36,7 +36,12 @@ void MainWindow::setupWebView() {
|
|||
void MainWindow::fullScreenRequested(
|
||||
QWebEngineFullScreenRequest fullScreenRequest) {
|
||||
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(); }
|
||||
|
|
|
@ -22,6 +22,7 @@ private:
|
|||
QWebEngineProfile *prepareProfile();
|
||||
DiscordPage *m_discordPage;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
bool m_wasMaximized;
|
||||
|
||||
private Q_SLOTS:
|
||||
void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
|
||||
|
|
Loading…
Reference in New Issue