blob: a9f101f84597a8ea3227d5c452eeaa72363e9867 (
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
30
31
32
33
34
|
#include "button.hpp"
#include "graph/graph.hpp"
#include "ui/ui_manager.hpp"
namespace cru::ui::controls
{
Button::Button() : Control(true),
normal_border_{UiManager::GetInstance()->GetPredefineResources()->button_normal_border},
pressed_border_{UiManager::GetInstance()->GetPredefineResources()->button_press_border}
{
SetBordered(true);
GetBorderProperty() = normal_border_;
SetCursor(cursors::hand);
}
StringView Button::GetControlType() const
{
return control_type;
}
void Button::OnMouseClickBegin(MouseButton button)
{
GetBorderProperty() = pressed_border_;
UpdateBorder();
}
void Button::OnMouseClickEnd(MouseButton button)
{
GetBorderProperty() = normal_border_;
UpdateBorder();
}
}
|