mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
double click support
This commit is contained in:
parent
b6f2456a82
commit
a678eddb77
7 changed files with 102 additions and 10 deletions
|
|
@ -64,10 +64,24 @@ UINode* UINode::listenAction(onaction action) {
|
|||
return this;
|
||||
}
|
||||
|
||||
UINode* UINode::listenDoubleClick(onaction action) {
|
||||
doubleClickCallbacks.push_back(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
void UINode::click(GUI*, int, int) {
|
||||
pressed = true;
|
||||
}
|
||||
|
||||
void UINode::doubleClick(GUI* gui, int x, int y) {
|
||||
pressed = true;
|
||||
if (isInside(glm::vec2(x, y))) {
|
||||
for (auto callback : doubleClickCallbacks) {
|
||||
callback(gui);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UINode::mouseRelease(GUI* gui, int x, int y) {
|
||||
pressed = false;
|
||||
if (isInside(glm::vec2(x, y))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue