#pragma once #include "settingsmanager.hpp" #include "settingssnapshot.hpp" #include "widgets/helper/settingsdialogtab.hpp" #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); static void showDialog(); protected: virtual void dpiMultiplierChanged(float oldDpi, float newDpi) override; private: SettingsSnapshot snapshot; std::vector tabs; pajlada::Settings::Setting usernameDisplayMode; struct { QVBoxLayout tabs; QVBoxLayout vbox; QHBoxLayout hbox; QWidget tabWidget; QStackedLayout pageStack; QDialogButtonBox buttonBox; QPushButton okButton; QPushButton cancelButton; } ui; void addTab(QBoxLayout *layout, QString title, QString imageRes); void addTabs(); QVBoxLayout *createAccountsTab(); QVBoxLayout *createAppearanceTab(); QVBoxLayout *createMessagesTab(); QVBoxLayout *createBehaviourTab(); QVBoxLayout *createCommandsTab(); QVBoxLayout *createEmotesTab(); QVBoxLayout *createIgnoredUsersTab(); QVBoxLayout *createIgnoredMessagesTab(); QVBoxLayout *createLinksTab(); QVBoxLayout *createLogsTab(); QVBoxLayout *createHighlightingTab(); QVBoxLayout *createWhispersTab(); SettingsDialogTab *selectedTab = nullptr; QListWidget *globalHighlights; /// Widget creation helpers QVBoxLayout *createTabLayout(); 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); QHBoxLayout *createCombobox( const QString &title, pajlada::Settings::Setting &setting, QStringList items, std::function &)> cb); QLineEdit *createLineEdit(pajlada::Settings::Setting &setting); void okButtonClicked(); void cancelButtonClicked(); std::vector managedConnections; static void setChildrensFont(QLayout *object, QFont &font, int indent = 0); }; } // namespace widgets } // namespace chatterino