summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-28 23:05:49 +0800
committerruki <[email protected]>2020-10-28 23:05:49 +0800
commitb888d536f76430c09abe315fa1749f0c1d2d60be (patch)
tree78828e696ababd309e5c586b9301e940339aaad6
parent574f40bea7bcf2cb180865dd96c0d684c72e032c (diff)
fix select choicebox
-rw-r--r--xmake/core/ui/choicebox.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/core/ui/choicebox.lua b/xmake/core/ui/choicebox.lua
index c65dc9ab8..e93452228 100644
--- a/xmake/core/ui/choicebox.lua
+++ b/xmake/core/ui/choicebox.lua
@@ -99,6 +99,18 @@ end
-- do select the current config
function choicebox:_do_select()
+ -- clear selected text
+ for v in self:views() do
+ local text = v:text()
+ if text and text:startswith("(X) ") then
+ local i = v:extra("index")
+ if i then
+ local t = self._VALUES[i]
+ v:text_set("( ) " .. tostring(t))
+ end
+ end
+ end
+
-- get the current item
local item = self:current()