perf: Speed Up Opening of Settings Dialog (#4193)

fix https://github.com/Chatterino/chatterino2/issues/1266
This commit is contained in:
nerix
2022-11-27 20:15:22 +01:00
committed by GitHub
parent 032f290767
commit a16342fd82
3 changed files with 12 additions and 6 deletions
+7 -3
View File
@@ -81,7 +81,7 @@ BaseWindow::BaseWindow(FlagsEnum<Flags> _flags, QWidget *parent)
this->updateScale();
});
},
this->connections_);
this->connections_, false);
this->updateScale();
@@ -786,8 +786,12 @@ bool BaseWindow::handleSHOWWINDOW(MSG *msg)
#ifdef USEWINSDK
if (auto dpi = getWindowDpi(msg->hwnd))
{
this->nativeScale_ = dpi.get() / 96.f;
this->updateScale();
float currentScale = (float)dpi.get() / 96.F;
if (currentScale != this->nativeScale_)
{
this->nativeScale_ = currentScale;
this->updateScale();
}
}
if (!this->shown_ && this->isVisible())