mirror of
https://github.com/kepler155c/opus
synced 2024-11-10 18:59:55 +00:00
cleanup
This commit is contained in:
parent
cc1a2bfbf4
commit
4dc6062043
@ -263,7 +263,6 @@ function Manager:click(target, code, button, x, y)
|
|||||||
if clickEvent.element.focus then
|
if clickEvent.element.focus then
|
||||||
target:setFocus(clickEvent.element)
|
target:setFocus(clickEvent.element)
|
||||||
end
|
end
|
||||||
_G._p = clickEvent
|
|
||||||
self:inputEvent(clickEvent.element, clickEvent)
|
self:inputEvent(clickEvent.element, clickEvent)
|
||||||
|
|
||||||
target:sync()
|
target:sync()
|
||||||
|
@ -16,5 +16,10 @@ function UI.Text:setParent()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function UI.Text:draw()
|
function UI.Text:draw()
|
||||||
self:write(1, 1, Util.widthify(self.value or '', self.width), self.backgroundColor)
|
if self.align and self.align == 'center' then
|
||||||
|
self:clear()
|
||||||
|
self:centeredWrite(1, self.value or '')
|
||||||
|
else
|
||||||
|
self:write(1, 1, Util.widthify(self.value or '', self.width))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
_G.requireInjector(_ENV)
|
|
||||||
|
|
||||||
local Event = require('event')
|
local Event = require('event')
|
||||||
local UI = require('ui')
|
local UI = require('ui')
|
||||||
local Util = require('util')
|
|
||||||
|
|
||||||
local kernel = _G.kernel
|
local kernel = _G.kernel
|
||||||
local multishell = _ENV.multishell
|
local multishell = _ENV.multishell
|
||||||
@ -51,15 +48,15 @@ function page:eventHandler(event)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function page.grid:getDisplayValues(row)
|
function page.grid:getDisplayValues(row)
|
||||||
row = Util.shallowCopy(row)
|
|
||||||
local elapsed = os.clock()-row.timestamp
|
local elapsed = os.clock()-row.timestamp
|
||||||
if elapsed < 60 then
|
return {
|
||||||
row.timestamp = string.format("%ds", math.floor(elapsed))
|
uid = row.uid,
|
||||||
else
|
title = row.title,
|
||||||
row.timestamp = string.format("%sm", math.floor(elapsed/6)/10)
|
status = row.isDead and 'error' or coroutine.status(row.co),
|
||||||
end
|
timestamp = elapsed < 60 and
|
||||||
row.status = row.isDead and 'error' or coroutine.status(row.co)
|
string.format("%ds", math.floor(elapsed)) or
|
||||||
return row
|
string.format("%sm", math.floor(elapsed/6)/10),
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
Event.onInterval(1, function()
|
Event.onInterval(1, function()
|
||||||
|
Loading…
Reference in New Issue
Block a user