From d16bbf6899cdea515fe99d6306349bc31ab61a1f Mon Sep 17 00:00:00 2001 From: fourtf Date: Sat, 13 Jan 2018 00:18:18 +0100 Subject: [PATCH] fixed icons in settings pages --- src/widgets/settingsdialog.cpp | 2 +- src/widgets/settingspages/behaviourpage.cpp | 2 +- src/widgets/settingspages/settingspage.cpp | 9 +++++++-- src/widgets/settingspages/settingspage.hpp | 5 +++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/widgets/settingsdialog.cpp b/src/widgets/settingsdialog.cpp index cb7f1dea4..d201302cd 100644 --- a/src/widgets/settingsdialog.cpp +++ b/src/widgets/settingsdialog.cpp @@ -88,7 +88,7 @@ void SettingsDialog::addTabs() void SettingsDialog::addTab(settingspages::SettingsPage *page, Qt::Alignment alignment) { - auto tab = new SettingsDialogTab(this, page, "xD"); + auto tab = new SettingsDialogTab(this, page, page->getIconResource()); this->ui.pageStack->addWidget(page); this->ui.tabContainer->addWidget(tab, 0, alignment); diff --git a/src/widgets/settingspages/behaviourpage.cpp b/src/widgets/settingspages/behaviourpage.cpp index c26afc93f..3a039270a 100644 --- a/src/widgets/settingspages/behaviourpage.cpp +++ b/src/widgets/settingspages/behaviourpage.cpp @@ -17,7 +17,7 @@ namespace chatterino { namespace widgets { namespace settingspages { BehaviourPage::BehaviourPage() - : SettingsPage("Behaviour", nullptr) + : SettingsPage("Behaviour", ":/images/behave.svg") { singletons::SettingManager &settings = singletons::SettingManager::getInstance(); util::LayoutCreator layoutCreator(this); diff --git a/src/widgets/settingspages/settingspage.cpp b/src/widgets/settingspages/settingspage.cpp index 10e6d6197..ca9153ba3 100644 --- a/src/widgets/settingspages/settingspage.cpp +++ b/src/widgets/settingspages/settingspage.cpp @@ -6,9 +6,9 @@ namespace chatterino { namespace widgets { namespace settingspages { -SettingsPage::SettingsPage(const QString &_name, const QString &_resourceName) +SettingsPage::SettingsPage(const QString &_name, const QString &_iconResource) : name(_name) - , resourceName(_resourceName) + , iconResource(_iconResource) { } @@ -17,6 +17,11 @@ const QString &SettingsPage::getName() return this->name; } +const QString &SettingsPage::getIconResource() +{ + return this->iconResource; +} + void SettingsPage::cancel() { this->onCancel.invoke(); diff --git a/src/widgets/settingspages/settingspage.hpp b/src/widgets/settingspages/settingspage.hpp index 623bd3d8d..e669f37f9 100644 --- a/src/widgets/settingspages/settingspage.hpp +++ b/src/widgets/settingspages/settingspage.hpp @@ -14,9 +14,10 @@ namespace settingspages { class SettingsPage : public QWidget { public: - SettingsPage(const QString &name, const QString &resourceName); + SettingsPage(const QString &name, const QString &iconResource); const QString &getName(); + const QString &getIconResource(); void cancel(); @@ -27,7 +28,7 @@ public: protected: QString name; - QString resourceName; + QString iconResource; pajlada::Signals::NoArgSignal onCancel; std::vector managedConnections;