diff options
| author | ruki <[email protected]> | 2020-11-12 00:45:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-12 00:45:53 +0800 |
| commit | a027a704b2799c402f983cf373f689d0d9c6efdc (patch) | |
| tree | 8c95f9ccec02acbccef90217d63aff436903f9e8 | |
| parent | 225456892fe91e9d109a1493d387e23fa4721dd2 (diff) | |
improve panel:remove
| -rw-r--r-- | xmake/core/ui/panel.lua | 8 |
1 files 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 |
