diff options
| author | ruki <[email protected]> | 2018-01-13 00:37:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-01-12 21:45:36 +0800 |
| commit | 788f52e46e4333be8522f80cd033eba206fda3ff (patch) | |
| tree | ac4db1a6452e489f817ae3a37b280840e916b8c9 /xmake/core/ui/panel.lua | |
| parent | bcb58d536cb131be4358d8893cfd1db77f72d942 (diff) | |
add resize state
Diffstat (limited to 'xmake/core/ui/panel.lua')
| -rw-r--r-- | xmake/core/ui/panel.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xmake/core/ui/panel.lua b/xmake/core/ui/panel.lua index 6576c0b24..417f1d725 100644 --- a/xmake/core/ui/panel.lua +++ b/xmake/core/ui/panel.lua @@ -276,6 +276,26 @@ function panel:draw() end end +-- resize panel +function panel:resize() + + -- resize panel? + local resize = self:state("resize") + if resize then + view.resize(self) + end + + -- resize all child views + for v in self:views() do + if resize then + v:state_set("resize", true) + end + if v:state("visible") and (v:state("resize") or v:type() == "panel") then + v:resize() + end + end +end + -- refresh panel function panel:refresh() |
