mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add 'onfocus' ui event & optimize container:add
This commit is contained in:
parent
8e8cabf2d1
commit
1e90115a26
9 changed files with 31 additions and 10 deletions
|
|
@ -74,6 +74,11 @@ UINode* UINode::listenDoubleClick(const onaction& action) {
|
|||
return this;
|
||||
}
|
||||
|
||||
UINode* UINode::listenFocus(const onaction& action) {
|
||||
focusCallbacks.listen(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
UINode* UINode::listenDefocus(const onaction& action) {
|
||||
defocusCallbacks.listen(action);
|
||||
return this;
|
||||
|
|
@ -101,6 +106,11 @@ bool UINode::isPressed() const {
|
|||
return pressed;
|
||||
}
|
||||
|
||||
void UINode::onFocus() {
|
||||
focused = true;
|
||||
focusCallbacks.notify(gui);
|
||||
}
|
||||
|
||||
void UINode::defocus() {
|
||||
focused = false;
|
||||
defocusCallbacks.notify(gui);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue