color rework + cleanup

This commit is contained in:
kepler155c@gmail.com
2020-04-16 23:13:19 -06:00
parent 3e41996b9b
commit 9d2a76f4ea
28 changed files with 364 additions and 238 deletions

View File

@@ -1,4 +1,5 @@
local class = require('opus.class')
local Event = require('opus.event')
local Terminal = require('opus.terminal')
local UI = require('opus.ui')
@@ -19,10 +20,16 @@ function UI.Embedded:layout()
UI.Window.layout(self)
if not self.win then
local t
function self.render()
self:sync()
if self.focused then
self:setCursorPos(self.win.getCursorPos())
if not t then
t = Event.onTimeout(0, function()
t = nil
if self.focused then
self:setCursorPos(self.win.getCursorPos())
end
self:sync()
end)
end
end
self.win = Terminal.window(UI.term.device, self.x, self.y, self.width, self.height, false)
@@ -68,7 +75,6 @@ function UI.Embedded:eventHandler(event)
end
function UI.Embedded.example()
local Event = require('opus.event')
local Util = require('opus.util')
local term = _G.term