libui+libos: Move Action to libos
This commit is contained in:
parent
945cfab3eb
commit
0b2a835336
@ -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 <luna/Heap.h>
|
||||
|
||||
namespace ui
|
||||
namespace os
|
||||
{
|
||||
class Action
|
||||
{
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <ui/Action.h>
|
||||
#include <os/Action.h>
|
||||
#include <ui/Widget.h>
|
||||
|
||||
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<EventResult> handle_mouse_move(Point position) override;
|
||||
Result<EventResult> 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;
|
||||
};
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user