summaryrefslogtreecommitdiff
path: root/xmake/core/ui/button.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-21 00:48:31 +0800
committerruki <[email protected]>2020-11-21 00:48:31 +0800
commit6aa64df1ce672b5d2cd37707d5673089c0a33e3f (patch)
tree41f213925bfe1e7f6d489a5da052bf08aa174c7e /xmake/core/ui/button.lua
parent96ce788dce7a63ab62c47750214f355c9c2eeced (diff)
support mouse for menuconf
Diffstat (limited to 'xmake/core/ui/button.lua')
-rw-r--r--xmake/core/ui/button.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/ui/button.lua b/xmake/core/ui/button.lua
index 6ef5b0723..674bc7496 100644
--- a/xmake/core/ui/button.lua
+++ b/xmake/core/ui/button.lua
@@ -41,8 +41,13 @@ function button:init(name, bounds, text, on_action)
-- show cursor
self:cursor_show(true)
- -- init action
+ -- init actions
+ self:option_set("mouseable", true)
self:action_set(action.ac_on_enter, on_action)
+ self:action_set(action.ac_on_clicked, function (v)
+ v:action_on(action.ac_on_enter)
+ return true
+ end)
end
-- draw button