Develop 1.8 #20

Merged
Kan18 merged 242 commits from develop-1.8 into master-1.8 2019-11-10 20:52:08 -05:00
3 changed files with 14 additions and 13 deletions
Showing only changes of commit 4dc6062043 - Show all commits

View File

@@ -263,7 +263,6 @@ function Manager:click(target, code, button, x, y)
if clickEvent.element.focus then
target:setFocus(clickEvent.element)
end
_G._p = clickEvent
self:inputEvent(clickEvent.element, clickEvent)
target:sync()

View File

@@ -16,5 +16,10 @@ function UI.Text:setParent()
end
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

View File

@@ -1,8 +1,5 @@
_G.requireInjector(_ENV)
local Event = require('event')
local UI = require('ui')
local Util = require('util')
local kernel = _G.kernel
local multishell = _ENV.multishell
@@ -51,15 +48,15 @@ function page:eventHandler(event)
end
function page.grid:getDisplayValues(row)
row = Util.shallowCopy(row)
local elapsed = os.clock()-row.timestamp
if elapsed < 60 then
row.timestamp = string.format("%ds", math.floor(elapsed))
else
row.timestamp = string.format("%sm", math.floor(elapsed/6)/10)
end
row.status = row.isDead and 'error' or coroutine.status(row.co)
return row
return {
uid = row.uid,
title = row.title,
status = row.isDead and 'error' or coroutine.status(row.co),
timestamp = elapsed < 60 and
string.format("%ds", math.floor(elapsed)) or
string.format("%sm", math.floor(elapsed/6)/10),
}
end
Event.onInterval(1, function()