2017-01-01 18:43:52 +01:00
|
|
|
#ifndef SETTINGSNOTEBOOKTAB_H
|
|
|
|
#define SETTINGSNOTEBOOKTAB_H
|
|
|
|
|
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 {
|
|
|
|
|
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-18 04:33:30 +01:00
|
|
|
Q_PROPERTY(bool getSelected READ getSelected WRITE setSelected NOTIFY
|
|
|
|
selectedChanged)
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2017-01-01 18:43:52 +01:00
|
|
|
public:
|
2017-01-11 18:52:09 +01:00
|
|
|
SettingsDialogTab(SettingsDialog *dialog, QString label, QString imageRes);
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
void
|
|
|
|
setSelected(bool selected)
|
2017-01-02 03:02:32 +01:00
|
|
|
{
|
2017-01-18 14:48:42 +01:00
|
|
|
if (this->selected == selected)
|
2017-01-11 18:52:09 +01:00
|
|
|
return;
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2017-01-18 14:48:42 +01:00
|
|
|
this->selected = selected;
|
2017-01-02 03:02:32 +01:00
|
|
|
emit selectedChanged(selected);
|
|
|
|
}
|
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
bool
|
2017-01-18 04:33:30 +01:00
|
|
|
getSelected() const
|
2017-01-11 18:52:09 +01:00
|
|
|
{
|
2017-01-18 14:48:42 +01:00
|
|
|
return this->selected;
|
2017-01-11 18:52:09 +01:00
|
|
|
}
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
QWidget *
|
|
|
|
getWidget()
|
|
|
|
{
|
2017-01-18 14:48:42 +01:00
|
|
|
return this->widget;
|
2017-01-18 04:33:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
setWidget(QWidget *widget)
|
|
|
|
{
|
|
|
|
this->widget = widget;
|
|
|
|
}
|
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-01-02 03:02:32 +01:00
|
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
QWidget *widget;
|
2017-01-01 18:43:52 +01:00
|
|
|
QString label;
|
2017-01-02 03:02:32 +01:00
|
|
|
QImage image;
|
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
SettingsDialog *dialog = NULL;
|
2017-01-02 03:02:32 +01:00
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
bool selected = false;
|
2017-01-01 18:43:52 +01:00
|
|
|
};
|
2017-01-18 21:30:23 +01:00
|
|
|
}
|
|
|
|
}
|
2017-01-01 18:43:52 +01:00
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
#endif // SETTINGSNOTEBOOKTAB_H
|