From b888d536f76430c09abe315fa1749f0c1d2d60be Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 28 Oct 2020 23:05:49 +0800 Subject: fix select choicebox --- xmake/core/ui/choicebox.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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() -- cgit v1.3.1