diff --git a/libui/include/ui/Action.h b/libos/include/os/Action.h similarity index 87% rename from libui/include/ui/Action.h rename to libos/include/os/Action.h index 4955ffd4..f49e100b 100644 --- a/libui/include/ui/Action.h +++ b/libos/include/os/Action.h @@ -1,7 +1,16 @@ +/** + * @file Action.h + * @author apio (cloudapio.eu) + * @brief Wrapper for callable objects, like function pointers or lambdas. + * + * @copyright Copyright (c) 2023, the Luna authors. + * + */ + #pragma once #include -namespace ui +namespace os { class Action { diff --git a/libui/include/ui/Button.h b/libui/include/ui/Button.h index a73df5df..38d5f512 100644 --- a/libui/include/ui/Button.h +++ b/libui/include/ui/Button.h @@ -8,7 +8,7 @@ */ #pragma once -#include +#include #include namespace ui @@ -19,7 +19,7 @@ namespace ui Button(Rect rect); void set_widget(Widget& widget); - void set_action(Action&& action); + void set_action(os::Action&& action); Result handle_mouse_move(Point position) override; Result handle_mouse_leave() override; @@ -32,6 +32,6 @@ namespace ui bool m_hovered { false }; bool m_clicked { false }; Widget* m_child; - Action m_action; + os::Action m_action; }; } diff --git a/libui/src/Button.cpp b/libui/src/Button.cpp index ab412cb1..14e5ceb1 100644 --- a/libui/src/Button.cpp +++ b/libui/src/Button.cpp @@ -24,7 +24,7 @@ namespace ui widget.set_parent(this); } - void Button::set_action(Action&& action) + void Button::set_action(os::Action&& action) { m_action = move(action); }