From a027a704b2799c402f983cf373f689d0d9c6efdc Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 12 Nov 2020 00:45:53 +0800 Subject: improve panel:remove --- xmake/core/ui/panel.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xmake/core/ui/panel.lua b/xmake/core/ui/panel.lua index 011eed19a..f08bceade 100644 --- a/xmake/core/ui/panel.lua +++ b/xmake/core/ui/panel.lua @@ -144,7 +144,7 @@ function panel:insert(v, opt) end -- remove view -function panel:remove(v) +function panel:remove(v, opt) -- check assert(v:parent() == self) @@ -158,7 +158,11 @@ function panel:remove(v) -- select next view if self:current() == v then - self:select_next(nil, true) + if opt and opt.select_prev then + self:select_prev(nil, true) + else + self:select_next(nil, true) + end end -- invalidate it -- cgit v1.3.1