mirror-chatterino2/notebooktab.h

51 lines
1 KiB
C
Raw Normal View History

2016-12-29 17:31:07 +01:00
#ifndef NOTEBOOKTAB_H
#define NOTEBOOKTAB_H
2016-12-30 18:00:25 +01:00
#include "QWidget"
2016-12-29 17:31:07 +01:00
2016-12-29 18:02:13 +01:00
class Notebook;
2016-12-30 18:00:25 +01:00
class NotebookPage;
2016-12-29 18:02:13 +01:00
2016-12-29 17:31:07 +01:00
class NotebookTab : public QWidget
{
Q_OBJECT
public:
2016-12-30 12:20:26 +01:00
NotebookTab(Notebook *notebook);
2016-12-30 18:00:25 +01:00
void calcSize();
NotebookPage* page;
QString text;
bool getSelected();
void setSelected(bool value);
2017-01-01 02:30:42 +01:00
int getHighlightStyle();
void setHighlightStyle(int style);
static const int HighlightNone = 0;
static const int HighlightHighlighted = 1;
static const int HighlightNewMessage = 2;
2016-12-30 12:20:26 +01:00
protected:
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void enterEvent(QEvent *) Q_DECL_OVERRIDE;
void leaveEvent(QEvent *) Q_DECL_OVERRIDE;
2017-01-01 02:30:42 +01:00
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
2016-12-29 17:31:07 +01:00
private:
Notebook *notebook;
2016-12-30 18:00:25 +01:00
bool selected = false;
2016-12-30 12:20:26 +01:00
bool mouseOver = false;
bool mouseDown = false;
2017-01-01 02:30:42 +01:00
int highlightStyle;
2016-12-29 17:31:07 +01:00
};
#endif // NOTEBOOKTAB_H