#pragma once #include "settingsmanager.hpp" #include "settingssnapshot.hpp" #include "widgets/settingsdialogtab.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include namespace chatterino { namespace widgets { class SettingsDialog : public QWidget { public: SettingsDialog(); void select(SettingsDialogTab *tab); static void showDialog(); private: SettingsSnapshot snapshot; pajlada::Settings::Setting usernameDisplayMode; struct { QVBoxLayout tabs; QVBoxLayout vbox; QHBoxLayout hbox; QStackedLayout pageStack; QDialogButtonBox buttonBox; QPushButton okButton; QPushButton cancelButton; } ui; void addTab(QLayout *layout, QString title, QString imageRes); void addTabs(); SettingsDialogTab *selectedTab = nullptr; QListWidget *globalHighlights; /// Widget creation helpers QCheckBox *createCheckbox(const QString &title, Setting &setting); QCheckBox *createCheckbox(const QString &title, pajlada::Settings::Setting &setting); QHBoxLayout *createCombobox(const QString &title, pajlada::Settings::Setting &setting, QStringList items, std::function &)> cb); QLineEdit *createLineEdit(pajlada::Settings::Setting &setting); void okButtonClicked(); void cancelButtonClicked(); }; } // namespace widgets } // namespace chatterino