mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
1043f9f803
* refactor: remove unnecessary includes in headers * fix: formatting * chore: changelog * fix: scrollbar * fix: suggestions and old appbase remains * fix: suggestion * fix: missing Qt forward declarations * fix: another qt include * fix: includes for precompiled-headers=off * Add missing `<memory>` includes * Add missing `#pragma once` * Fix tests Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
61 lines
1.1 KiB
C++
61 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "widgets/BaseWidget.hpp"
|
|
|
|
#include <QIcon>
|
|
#include <QPaintEvent>
|
|
#include <QWidget>
|
|
|
|
#include <functional>
|
|
|
|
namespace chatterino {
|
|
|
|
class SettingsPage;
|
|
class SettingsDialog;
|
|
|
|
enum class SettingsTabId {
|
|
None,
|
|
Accounts,
|
|
Moderation,
|
|
};
|
|
|
|
class SettingsDialogTab : public BaseWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SettingsDialogTab(SettingsDialog *dialog_,
|
|
std::function<SettingsPage *()> page_,
|
|
const QString &name, QString imageFileName,
|
|
SettingsTabId id);
|
|
|
|
void setSelected(bool selected_);
|
|
SettingsPage *page();
|
|
SettingsTabId id() const;
|
|
|
|
const QString &name() const;
|
|
|
|
signals:
|
|
void selectedChanged(bool);
|
|
|
|
private:
|
|
void paintEvent(QPaintEvent *);
|
|
void mousePressEvent(QMouseEvent *event);
|
|
|
|
struct {
|
|
QString labelText;
|
|
QIcon icon;
|
|
} ui_;
|
|
|
|
// Parent settings dialog
|
|
SettingsDialog *dialog_{};
|
|
SettingsPage *page_{};
|
|
std::function<SettingsPage *()> lazyPage_;
|
|
SettingsTabId id_;
|
|
QString name_;
|
|
|
|
bool selected_ = false;
|
|
};
|
|
|
|
} // namespace chatterino
|