From b518aa8488160469fe511beaddf314f7d02acd9c Mon Sep 17 00:00:00 2001 From: ezavod Date: Wed, 31 May 2017 17:16:55 +0200 Subject: [PATCH] refactor(ui): set icon in dialog constructor Fixes #4430. Moved `setWindowIcon` to dialog constructor and removed all other occurrences. --- src/widget/widget.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 5369e794e..786b9395c 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -841,7 +841,6 @@ void Widget::onShowSettings() } setActiveToolMenuButton(ActiveToolMenuButton::None); - settingsWidget->setWindowIcon(QIcon(":/img/icons/qtox.svg")); } else { hideMainForms(nullptr); settingsWidget->show(contentLayout); @@ -858,7 +857,6 @@ void Widget::showProfile() // onAvatarClicked, onUsernameClicked } setActiveToolMenuButton(ActiveToolMenuButton::None); - settingsWidget->setWindowIcon(QIcon(":/img/icons/qtox.svg")); } else { hideMainForms(nullptr); profileForm->show(contentLayout); @@ -1521,6 +1519,7 @@ ContentLayout* Widget::createContentDialog(DialogType type) const restoreGeometry(Settings::getInstance().getDialogSettingsGeometry()); Translator::registerHandler(std::bind(&Dialog::retranslateUi, this), this); retranslateUi(); + setWindowIcon(QIcon(":/img/icons/qtox.svg")); connect(Core::getInstance(), &Core::usernameSet, this, &Dialog::retranslateUi); } @@ -1536,7 +1535,6 @@ ContentLayout* Widget::createContentDialog(DialogType type) const { setWindowTitle(Core::getInstance()->getUsername() + QStringLiteral(" - ") + Widget::fromDialogType(type)); - setWindowIcon(QIcon(":/img/icons/qtox.svg")); } protected: