diff options
| author | ruki <[email protected]> | 2017-12-26 00:34:40 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-12-25 21:28:00 +0800 |
| commit | 6d5b0370398a581f14569ea7b63d31217d4252fc (patch) | |
| tree | 026294ac4bf021bafe96c818c4b7e82b52d327e3 /xmake/core/ui/statusbar.lua | |
| parent | 994f26116837e8502af2ea8ce81ce7aa2f3d9f94 (diff) | |
add background for ui view
Diffstat (limited to 'xmake/core/ui/statusbar.lua')
| -rw-r--r-- | xmake/core/ui/statusbar.lua | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/xmake/core/ui/statusbar.lua b/xmake/core/ui/statusbar.lua index 634bdbfc3..18688e86f 100644 --- a/xmake/core/ui/statusbar.lua +++ b/xmake/core/ui/statusbar.lua @@ -22,11 +22,6 @@ -- @file statusbar.lua -- ---[[ Console User Interface (cui) ]----------------------------------------- -Author: Tiago Dionizio (tiago.dionizio AT gmail.com) -$Id: statusbar.lua 18 2007-06-21 20:43:52Z tngd $ ---------------------------------------------------------------------------]] - -- load modules local log = require("ui/log") local view = require("ui/view") @@ -44,6 +39,9 @@ function statusbar:init(name, bounds, commands) -- init info self:info_set("") + + -- init background + self:background_set(curses.color_pair("blue", "white")) end -- exit statusbar @@ -54,22 +52,11 @@ end -- draw view function statusbar:draw() - -- trace - log:print("%s: draw ..", self) - - -- get canvas - local c = self:canvas() - c:move(0, 0) - - -- draw statusbar - local x = 0 - local color = self:attr("color") - if x < self:width() then - c:attr(color):write(string.rep(' ', self:width() - x)) - end + -- draw background + view.draw(self) -- draw status info - c:move(1, 0):write(self:info()) + self:canvas():move(1, 0):write(self:info()) end -- on event |
