summaryrefslogtreecommitdiff
path: root/xmake/core/ui/statusbar.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-12-19 22:38:24 +0800
committerruki <[email protected]>2017-12-19 09:50:27 +0800
commit5924ef4adbe4b084c465bc9604254be60d147074 (patch)
tree93c00311a46d3ac7034b775ba4fa6b69212bff9f /xmake/core/ui/statusbar.lua
parentb061bd17789d582771c77778e17a4f5576e1a01f (diff)
remove some redraw ops
Diffstat (limited to 'xmake/core/ui/statusbar.lua')
-rw-r--r--xmake/core/ui/statusbar.lua13
1 files changed, 3 insertions, 10 deletions
diff --git a/xmake/core/ui/statusbar.lua b/xmake/core/ui/statusbar.lua
index fbdc46ff8..564ac4a15 100644
--- a/xmake/core/ui/statusbar.lua
+++ b/xmake/core/ui/statusbar.lua
@@ -36,13 +36,7 @@ local statusbar = statusbar or view()
-- init statusbar
function statusbar:init(name, bounds)
-
- -- init view
view.init(self, name, bounds)
-
- -- init attributes
- self:attr_set("key", curses.color_pair("red", "white"))
- self:attr_set("text", curses.color_pair("black", "white"))
end
-- exit statusbar
@@ -57,12 +51,11 @@ function statusbar:draw()
local c = self:canvas()
c:move(0, 0)
- -- draw status
+ -- draw statusbar
local x = 0
- local kattr = self:attr("key")
- local tattr = self:attr("text")
+ local color = self:attr("color")
if x < self:width() then
- c:attr(tattr):write(string.rep(' ', self:width() - x))
+ c:attr(color):write(string.rep(' ', self:width() - x))
end
end