From 0bb112a3c2132dc5829b3c0dba4c44e41a00d611 Mon Sep 17 00:00:00 2001 From: fourtf Date: Thu, 20 Feb 2020 23:47:25 +0100 Subject: [PATCH] improved performance of opening the settings dialog --- src/widgets/dialogs/SettingsDialog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/widgets/dialogs/SettingsDialog.cpp b/src/widgets/dialogs/SettingsDialog.cpp index 73ad5f756..e9769e3fd 100644 --- a/src/widgets/dialogs/SettingsDialog.cpp +++ b/src/widgets/dialogs/SettingsDialog.cpp @@ -28,13 +28,15 @@ SettingsDialog::SettingsDialog() { this->setWindowTitle("Chatterino Settings"); + this->themeChangedEvent(); + this->scaleChangedEvent(this->scale()); + this->initUi(); this->addTabs(); - this->scaleChangedEvent(this->scale()); - this->overrideBackgroundColor_ = QColor("#111111"); - this->themeChangedEvent(); + this->scaleChangedEvent( + this->scale()); // execute twice to fix performance + width of item this->resize(815, 600); } @@ -273,7 +275,8 @@ void SettingsDialog::scaleChangedEvent(float newDpi) this->setStyleSheet(styleSheet); - this->ui_.tabContainerContainer->setFixedWidth(int(150 * newDpi)); + if (this->ui_.tabContainerContainer) + this->ui_.tabContainerContainer->setFixedWidth(int(150 * newDpi)); } void SettingsDialog::themeChangedEvent()