#pragma once #include "singletons/settingsmanager.hpp" #include "widgets/accountswitchwidget.hpp" #include "widgets/helper/settingsdialogtab.hpp" #include "widgets/settingspages/appearancepage.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "basewidget.hpp" namespace chatterino { namespace widgets { class SettingsDialog : public BaseWidget { public: SettingsDialog(); void select(SettingsDialogTab *tab); friend class SettingsDialogTab; public: static SettingsDialog *getHandle(); // may be NULL enum class PreferredTab { NoPreference, Accounts, }; static void showDialog(PreferredTab preferredTab = PreferredTab::NoPreference); protected: virtual void dpiMultiplierChanged(float oldDpi, float newDpi) override; private: void refresh(); static SettingsDialog *handle; struct { QWidget *tabContainerContainer; QVBoxLayout *tabContainer; QStackedLayout *pageStack; QPushButton *okButton; QPushButton *cancelButton; } ui; std::vector tabs; void initUi(); void addTabs(); void addTab(settingspages::SettingsPage *page, Qt::Alignment alignment = Qt::AlignTop); SettingsDialogTab *selectedTab = nullptr; void okButtonClicked(); void cancelButtonClicked(); // static void setChildrensFont(QLayout *object, QFont &font, int indent = 0); }; } // namespace widgets } // namespace chatterino