summaryrefslogtreecommitdiff
path: root/xmake/core/ui/panel.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-01-13 00:37:36 +0800
committerruki <[email protected]>2018-01-12 21:45:36 +0800
commit788f52e46e4333be8522f80cd033eba206fda3ff (patch)
treeac4db1a6452e489f817ae3a37b280840e916b8c9 /xmake/core/ui/panel.lua
parentbcb58d536cb131be4358d8893cfd1db77f72d942 (diff)
add resize state
Diffstat (limited to 'xmake/core/ui/panel.lua')
-rw-r--r--xmake/core/ui/panel.lua20
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()