2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-01 18:43:52 +01:00
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "widgets/BaseWidget.hpp"
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2018-01-12 23:09:05 +01:00
|
|
|
#include <QIcon>
|
2017-01-18 04:52:47 +01:00
|
|
|
#include <QPaintEvent>
|
2017-01-01 18:43:52 +01:00
|
|
|
#include <QWidget>
|
Sort and force grouping of includes (#4172)
This change enforces strict include grouping using IncludeCategories
In addition to adding this to the .clang-format file and applying it in the tests/src and src directories, I also did the following small changes:
In ChatterSet.hpp, I changed lrucache to a <>include
In Irc2.hpp, I change common/SignalVector.hpp to a "project-include"
In AttachedWindow.cpp, NativeMessaging.cpp, WindowsHelper.hpp, BaseWindow.cpp, and StreamerMode.cpp, I disabled clang-format for the windows-includes
In WindowDescriptors.hpp, I added the missing vector include. It was previously not needed because the include was handled by another file that was previously included first.
clang-format minimum version has been bumped, so Ubuntu version used in the check-formatting job has been bumped to 22.04 (which is the latest LTS)
2022-11-27 19:32:53 +01:00
|
|
|
|
2020-02-21 01:59:58 +01:00
|
|
|
#include <functional>
|
2017-01-01 18:43:52 +01:00
|
|
|
|
2017-01-18 21:30:23 +01:00
|
|
|
namespace chatterino {
|
|
|
|
|
2018-06-26 16:37:59 +02:00
|
|
|
class SettingsPage;
|
2017-01-02 03:02:32 +01:00
|
|
|
class SettingsDialog;
|
|
|
|
|
2022-12-31 15:41:01 +01:00
|
|
|
enum class SettingsTabId {
|
2020-02-21 01:17:22 +01:00
|
|
|
None,
|
2023-05-27 12:38:25 +02:00
|
|
|
General,
|
2020-02-21 01:17:22 +01:00
|
|
|
Accounts,
|
|
|
|
Moderation,
|
|
|
|
};
|
|
|
|
|
2018-01-27 21:51:08 +01:00
|
|
|
class SettingsDialogTab : public BaseWidget
|
2017-01-01 18:43:52 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2017-01-01 18:43:52 +01:00
|
|
|
public:
|
2020-02-21 01:59:58 +01:00
|
|
|
SettingsDialogTab(SettingsDialog *dialog_,
|
|
|
|
std::function<SettingsPage *()> page_,
|
|
|
|
const QString &name, QString imageFileName,
|
2020-02-28 19:05:50 +01:00
|
|
|
SettingsTabId id);
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
void setSelected(bool selected_);
|
2020-02-21 00:46:19 +01:00
|
|
|
SettingsPage *page();
|
2020-02-21 01:17:22 +01:00
|
|
|
SettingsTabId id() const;
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2020-02-21 01:59:58 +01:00
|
|
|
const QString &name() const;
|
|
|
|
|
2017-01-02 03:02:32 +01:00
|
|
|
signals:
|
|
|
|
void selectedChanged(bool);
|
2017-01-01 18:43:52 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void paintEvent(QPaintEvent *);
|
2017-04-14 17:47:28 +02:00
|
|
|
void mousePressEvent(QMouseEvent *event);
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2017-07-02 12:36:50 +02:00
|
|
|
struct {
|
|
|
|
QString labelText;
|
2018-01-02 03:44:52 +01:00
|
|
|
QIcon icon;
|
2018-07-06 19:23:47 +02:00
|
|
|
} ui_;
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2017-07-02 12:36:50 +02:00
|
|
|
// Parent settings dialog
|
2020-02-21 01:59:58 +01:00
|
|
|
SettingsDialog *dialog_{};
|
|
|
|
SettingsPage *page_{};
|
|
|
|
std::function<SettingsPage *()> lazyPage_;
|
2020-02-21 01:17:22 +01:00
|
|
|
SettingsTabId id_;
|
2020-02-21 01:59:58 +01:00
|
|
|
QString name_;
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
bool selected_ = false;
|
2017-01-01 18:43:52 +01:00
|
|
|
};
|
2017-06-07 10:09:24 +02:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace chatterino
|