mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
perf: Speed Up Opening of Settings Dialog (#4193)
fix https://github.com/Chatterino/chatterino2/issues/1266
This commit is contained in:
parent
032f290767
commit
a16342fd82
|
@ -9,6 +9,7 @@
|
|||
- Bugfix: Fixed the wrong right-click menu showing in the chat input box. (#4177)
|
||||
- Bugfix: Fixed popup windows not appearing/minimizing correctly on the Windows taskbar. (#4181)
|
||||
- Bugfix: Fixed white border appearing around maximized window on Windows. (#4190)
|
||||
- Bugfix: Fixed window scaling being applied too many times on startup, causing windows like Settings to be slow. (#4193)
|
||||
|
||||
## 2.4.0-beta
|
||||
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -32,6 +32,10 @@ SettingsDialog::SettingsDialog(QWidget *parent)
|
|||
{
|
||||
this->setObjectName("SettingsDialog");
|
||||
this->setWindowTitle("Chatterino Settings");
|
||||
// Disable the ? button in the titlebar until we decide to use it
|
||||
this->setWindowFlags(this->windowFlags() &
|
||||
~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
this->resize(915, 600);
|
||||
this->themeChangedEvent();
|
||||
this->scaleChangedEvent(this->scale());
|
||||
|
@ -41,9 +45,6 @@ SettingsDialog::SettingsDialog(QWidget *parent)
|
|||
this->overrideBackgroundColor_ = QColor("#111111");
|
||||
this->scaleChangedEvent(this->scale()); // execute twice to width of item
|
||||
|
||||
// Disable the ? button in the titlebar until we decide to use it
|
||||
this->setWindowFlags(this->windowFlags() &
|
||||
~Qt::WindowContextHelpButtonHint);
|
||||
this->addShortcuts();
|
||||
this->signalHolder_.managedConnect(getApp()->hotkeys->onItemsUpdated,
|
||||
[this]() {
|
||||
|
|
Loading…
Reference in a new issue