aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls')
-rw-r--r--src/ui/controls/Button.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/ui/controls/Button.cpp b/src/ui/controls/Button.cpp
index 8bd9f93f..c6480b77 100644
--- a/src/ui/controls/Button.cpp
+++ b/src/ui/controls/Button.cpp
@@ -1,5 +1,4 @@
#include "cru/ui/controls/Button.hpp"
-#include <memory>
#include "../Helper.hpp"
#include "cru/platform/graphics/Brush.hpp"
@@ -10,38 +9,12 @@
#include "cru/ui/render/BorderRenderObject.hpp"
namespace cru::ui::controls {
-using cru::platform::gui::SystemCursorType;
-
-namespace {
-std::shared_ptr<platform::gui::ICursor> GetSystemCursor(SystemCursorType type) {
- return GetUiApplication()->GetCursorManager()->GetSystemCursor(type);
-}
-} // namespace
-
Button::Button() : click_detector_(this) {
render_object_ = std::make_unique<render::BorderRenderObject>();
render_object_->SetAttachedControl(this);
SetContainerRenderObject(render_object_.get());
render_object_->SetBorderEnabled(true);
- click_detector_.StateChangeEvent()->AddHandler(
- [this](const helper::ClickState& state) {
- switch (state) {
- case helper::ClickState::None:
- SetCursor(GetSystemCursor(SystemCursorType::Arrow));
- break;
- case helper::ClickState::Hover:
- SetCursor(GetSystemCursor(SystemCursorType::Hand));
- break;
- case helper::ClickState::Press:
- SetCursor(GetSystemCursor(SystemCursorType::Hand));
- break;
- case helper::ClickState::PressInactive:
- SetCursor(GetSystemCursor(SystemCursorType::Arrow));
- break;
- }
- });
-
GetStyleRuleSet()->SetParent(
&UiManager::GetInstance()->GetThemeResources()->button_style);
}