1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
#pragma once
#include <notifier.h>
#include "button_base.h"
#include "font.h"
#include "texturedbox.h"
namespace GUI
{
class ScrollEvent;
class TabButton
: public ButtonBase
{
public:
TabButton(Widget* parent, Widget* tab_widget);
virtual ~TabButton();
Widget* getTabWidget();
std::size_t getMinimalWidth() const;
std::size_t getMinimalHeight() const;
void setActive(bool active);
Notifier<Widget*> switchTabNotifier;
Notifier<float> scrollNotifier;
protected:
virtual void repaintEvent(RepaintEvent* e) override;
virtual void scrollEvent(ScrollEvent* scroll_event) override;
private:
void clickHandler();
Widget* tab_widget;
bool active{false};
TexturedBox tab_active{getImageCache(), ":resources/tab.png",
0, 0,
5, 1, 5,
5, 13, 1};
TexturedBox tab_passive{getImageCache(), ":resources/tab.png",
11, 0,
5, 1, 5,
5, 13, 1};
Font font{":resources/fontemboss.png"};
};
}
|