blob: b5164ca26ec758557ddd2d1a9e9058162dc4cf7d (
plain)
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
|
#pragma once
#include "GWidget.h"
#include <AK/AKString.h>
#include <AK/Function.h>
class GButton final : public GWidget {
public:
explicit GButton(GWidget* parent);
virtual ~GButton() override;
String caption() const { return m_caption; }
void set_caption(String&&);
Function<void(GButton&)> on_click;
private:
virtual void paint_event(GPaintEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;
virtual void mouseup_event(GMouseEvent&) override;
virtual void mousemove_event(GMouseEvent&) override;
virtual const char* class_name() const override { return "GButton"; }
String m_caption;
bool m_being_pressed { false };
bool m_tracking_cursor { false };
};
|