Skip to content

Commit

Permalink
fix: change zoom factor when app starts minimized in systray
Browse files Browse the repository at this point in the history
  • Loading branch information
keshavbhatt committed Oct 9, 2024
1 parent 4720ffe commit be47a73
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ void MainWindow::initSettingWidget() {

connect(m_settingsWidget, &SettingsWidget::zoomChanged, m_settingsWidget,
[=]() {
if (windowState() == Qt::WindowNoState) {
if (windowState() == Qt::WindowNoState ||
!(windowState() & Qt::WindowMaximized)) {
double currentFactor = SettingsManager::instance()
.settings()
.value("zoomFactor", 1.0)
Expand All @@ -310,8 +311,8 @@ void MainWindow::initSettingWidget() {

connect(m_settingsWidget, &SettingsWidget::zoomMaximizedChanged,
m_settingsWidget, [=]() {
if (windowState() == Qt::WindowMaximized ||
windowState() == Qt::WindowFullScreen) {
if (windowState() & Qt::WindowMaximized ||
windowState() & Qt::WindowFullScreen) {
double currentFactor = SettingsManager::instance()
.settings()
.value("zoomFactorMaximized",
Expand All @@ -332,7 +333,8 @@ void MainWindow::initSettingWidget() {
connect(m_settingsWidget, &SettingsWidget::updateFullWidthView,
m_settingsWidget, [=](bool checked) {
if (m_webEngine && m_webEngine->page()) {
WebEnginePage *wp = qobject_cast<WebEnginePage*>(m_webEngine->page());
WebEnginePage *wp =
qobject_cast<WebEnginePage *>(m_webEngine->page());
wp->injectClassChangeObserver();
if (checked)
m_webEngine->page()->runJavaScript(
Expand Down

0 comments on commit be47a73

Please sign in to comment.