diff options
| author | ruki <[email protected]> | 2018-01-10 00:46:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-01-09 22:39:52 +0800 |
| commit | 273ea08ed48c9c4a7d5355256a45285188297d82 (patch) | |
| tree | b01a43a43590027d40212088819b1b420316cd8d /xmake | |
| parent | 2fc03e778ad00bef537b5adb6cd40b70a64a2a96 (diff) | |
fix border color and height
Diffstat (limited to 'xmake')
| -rw-r--r-- | xmake/core/ui/program.lua | 11 | ||||
| -rw-r--r-- | xmake/core/ui/window.lua | 14 |
2 files changed, 18 insertions, 7 deletions
diff --git a/xmake/core/ui/program.lua b/xmake/core/ui/program.lua index 765d95732..2075a466d 100644 --- a/xmake/core/ui/program.lua +++ b/xmake/core/ui/program.lua @@ -141,6 +141,17 @@ function program:event() end end +-- on event +function program:event_on(e) + if panel.event_on(self, e) then + return true + end + if e.type == event.ev_keyboard and (e.key_name == "Esc" or e.key_name == "CtrlC") then + self:quit() + return true + end +end + -- put an event to view function program:event_put(e) diff --git a/xmake/core/ui/window.lua b/xmake/core/ui/window.lua index fae557747..821bf565d 100644 --- a/xmake/core/ui/window.lua +++ b/xmake/core/ui/window.lua @@ -86,18 +86,18 @@ function window:draw() local fbounds = self:frame():bounds() -- draw left and top border - self:canvas():attr(curses.color_pair(border[1], self:frame():background())) + self:canvas():attr({curses.color_pair(border[1], self:frame():background()), "standout"}) self:canvas():move(0, 0):putchar("hline", fbounds.ex) - self:canvas():move(0, 0):putchar('ulcorner') - self:canvas():move(0, 1):putchar('vline', fbounds.ey, true) - self:canvas():move(0, fbounds.ey):putchar('llcorner') + self:canvas():move(0, 0):putchar("ulcorner") + self:canvas():move(0, 1):putchar("vline", fbounds.ey - 1, true) + self:canvas():move(0, fbounds.ey):putchar("llcorner") -- draw bottom and right border self:canvas():attr(curses.color_pair(border[2], self:frame():background())) self:canvas():move(1, fbounds.ey):putchar("hline", fbounds.ex) - self:canvas():move(fbounds.ex, 0):putchar('urcorner') - self:canvas():move(fbounds.ex, 1):putchar('vline', fbounds.ey, true) - self:canvas():move(fbounds.ex, fbounds.ey):putchar('lrcorner') + self:canvas():move(fbounds.ex, 0):putchar("urcorner") + self:canvas():move(fbounds.ex, 1):putchar("vline", fbounds.ey - 1, true) + self:canvas():move(fbounds.ex, fbounds.ey):putchar("lrcorner") end -- draw title |
