Skip to content

Commit 77a999e

Browse files
committed
Improve Features
Delete hint when switching between FullScreen and Windowed Mode; Support closing MainWindow automatically when windowCloseRequested by webpage.
1 parent 8da4f87 commit 77a999e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spark-webapp-runtime/mainwindow.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ MainWindow::MainWindow(QString szTitle,
167167
connect(m_tray, &QSystemTrayIcon::activated, this, &MainWindow::trayIconActivated);
168168

169169
connect(m_widget->getPage()->profile(), &QWebEngineProfile::downloadRequested, this, &MainWindow::on_downloadStart);
170+
171+
connect(m_widget->getPage(), &QWebEnginePage::windowCloseRequested, this, [=]()
172+
{
173+
this->close();
174+
});
170175
}
171176

172177
MainWindow::~MainWindow()
@@ -195,7 +200,7 @@ void MainWindow::fullScreen()
195200
m_fixSize->setDisabled(true);
196201
m_menu->update();
197202
showFullScreen();
198-
DMessageManager::instance()->sendMessage(this, QIcon::fromTheme("dialog-information").pixmap(64, 64), QString(tr("%1Fullscreen Mode")).arg(" "));
203+
// DMessageManager::instance()->sendMessage(this, QIcon::fromTheme("dialog-information").pixmap(64, 64), QString(tr("%1Fullscreen Mode")).arg(" "));
199204
}
200205
else
201206
{
@@ -205,7 +210,7 @@ void MainWindow::fullScreen()
205210
}
206211
m_menu->update();
207212
showNormal();
208-
DMessageManager::instance()->sendMessage(this, QIcon::fromTheme("dialog-information").pixmap(64, 64), QString(tr("%1Windowed Mode")).arg(" "));
213+
// DMessageManager::instance()->sendMessage(this, QIcon::fromTheme("dialog-information").pixmap(64, 64), QString(tr("%1Windowed Mode")).arg(" "));
209214
}
210215
}
211216

0 commit comments

Comments
 (0)