mirror-chatterino2/src/widgets/helper/settingsdialogtab.hpp

47 lines
857 B
C++
Raw Normal View History

#pragma once
2017-01-01 18:43:52 +01: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>
2017-01-18 21:30:23 +01:00
namespace chatterino {
namespace widgets {
2018-01-12 23:09:05 +01:00
namespace settingspages {
class SettingsPage;
}
2017-01-18 21:30:23 +01:00
2017-01-02 03:02:32 +01:00
class SettingsDialog;
2017-01-01 18:43:52 +01:00
class SettingsDialogTab : public QWidget
{
Q_OBJECT
2017-01-02 03:02:32 +01:00
2017-01-01 18:43:52 +01:00
public:
2018-01-12 23:09:05 +01:00
SettingsDialogTab(SettingsDialog *dialog, settingspages::SettingsPage *page,
QString imageFileName);
2017-01-02 03:02:32 +01:00
2017-04-12 17:46:44 +02:00
void setSelected(bool selected);
2018-01-12 23:09:05 +01:00
settingspages::SettingsPage *getSettingsPage();
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;
QIcon icon;
2017-07-02 12:36:50 +02:00
} ui;
2017-01-02 03:02:32 +01:00
2017-07-02 12:36:50 +02:00
// Parent settings dialog
SettingsDialog *dialog;
2018-01-12 23:09:05 +01:00
settingspages::SettingsPage *page;
2017-01-02 03:02:32 +01:00
2017-07-02 12:36:50 +02:00
bool selected = false;
2017-01-01 18:43:52 +01:00
};
2017-04-14 17:52:22 +02:00
} // namespace widgets
} // namespace chatterino