summaryrefslogtreecommitdiff
path: root/xmake/core/ui/group.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-12-27 21:03:29 +0800
committerruki <[email protected]>2017-12-27 00:20:57 +0800
commit663308b956fb9cedbd002e980d716818f0b5e7b2 (patch)
treebc0e3aee5a547db50ff61d3a7cb793d2f7f36714 /xmake/core/ui/group.lua
parent603f29d146a735671c90d7430e7e5a200b749f74 (diff)
improve menubar and statusbar
Diffstat (limited to 'xmake/core/ui/group.lua')
-rw-r--r--xmake/core/ui/group.lua34
1 files changed, 11 insertions, 23 deletions
diff --git a/xmake/core/ui/group.lua b/xmake/core/ui/group.lua
index fada01444..571064260 100644
--- a/xmake/core/ui/group.lua
+++ b/xmake/core/ui/group.lua
@@ -246,33 +246,21 @@ end
-- draw group
function group:draw()
- -- draw it
- if self:state("redraw") then
+ -- redraw group?
+ local redraw = self:state("redraw")
- -- draw group background first
+ -- draw group background first
+ if redraw then
view.draw(self)
+ end
- -- draw all child views
- for v in self:views() do
- if v:state("visible") then
- v:draw()
- v:state_set("redraw", false)
- v:_mark_refresh()
- end
+ -- draw all child views
+ for v in self:views() do
+ if redraw then
+ v:state_set("redraw", true)
end
-
- -- clear mark
- self:state_set("redraw", false)
- self:_mark_refresh()
- else
-
- -- only draw child views
- for v in self:views() do
- if v:state("visible") and v:state("redraw") then
- v:draw()
- v:state_set("redraw", false)
- v:_mark_refresh()
- end
+ if v:state("visible") and v:state("redraw") then
+ v:draw()
end
end
end