fixed icons in settings pages

This commit is contained in:
fourtf 2018-01-13 00:18:18 +01:00
parent 2f0658935a
commit d16bbf6899
4 changed files with 12 additions and 6 deletions

View file

@ -88,7 +88,7 @@ void SettingsDialog::addTabs()
void SettingsDialog::addTab(settingspages::SettingsPage *page, Qt::Alignment alignment) 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.pageStack->addWidget(page);
this->ui.tabContainer->addWidget(tab, 0, alignment); this->ui.tabContainer->addWidget(tab, 0, alignment);

View file

@ -17,7 +17,7 @@ namespace chatterino {
namespace widgets { namespace widgets {
namespace settingspages { namespace settingspages {
BehaviourPage::BehaviourPage() BehaviourPage::BehaviourPage()
: SettingsPage("Behaviour", nullptr) : SettingsPage("Behaviour", ":/images/behave.svg")
{ {
singletons::SettingManager &settings = singletons::SettingManager::getInstance(); singletons::SettingManager &settings = singletons::SettingManager::getInstance();
util::LayoutCreator<BehaviourPage> layoutCreator(this); util::LayoutCreator<BehaviourPage> layoutCreator(this);

View file

@ -6,9 +6,9 @@ namespace chatterino {
namespace widgets { namespace widgets {
namespace settingspages { namespace settingspages {
SettingsPage::SettingsPage(const QString &_name, const QString &_resourceName) SettingsPage::SettingsPage(const QString &_name, const QString &_iconResource)
: name(_name) : name(_name)
, resourceName(_resourceName) , iconResource(_iconResource)
{ {
} }
@ -17,6 +17,11 @@ const QString &SettingsPage::getName()
return this->name; return this->name;
} }
const QString &SettingsPage::getIconResource()
{
return this->iconResource;
}
void SettingsPage::cancel() void SettingsPage::cancel()
{ {
this->onCancel.invoke(); this->onCancel.invoke();

View file

@ -14,9 +14,10 @@ namespace settingspages {
class SettingsPage : public QWidget class SettingsPage : public QWidget
{ {
public: public:
SettingsPage(const QString &name, const QString &resourceName); SettingsPage(const QString &name, const QString &iconResource);
const QString &getName(); const QString &getName();
const QString &getIconResource();
void cancel(); void cancel();
@ -27,7 +28,7 @@ public:
protected: protected:
QString name; QString name;
QString resourceName; QString iconResource;
pajlada::Signals::NoArgSignal onCancel; pajlada::Signals::NoArgSignal onCancel;
std::vector<pajlada::Signals::ScopedConnection> managedConnections; std::vector<pajlada::Signals::ScopedConnection> managedConnections;