mirror of
https://github.com/kepler155c/opus
synced 2025-01-31 09:34:45 +00:00
rename justify property to align
This commit is contained in:
parent
4dc6062043
commit
69e6af2314
@ -22,14 +22,14 @@ function Writer:init(element, y)
|
|||||||
self.x = 1
|
self.x = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function Writer:write(s, width, justify, bg, fg)
|
function Writer:write(s, width, align, bg, fg)
|
||||||
local len = #tostring(s or '')
|
local len = #tostring(s or '')
|
||||||
if len > width then
|
if len > width then
|
||||||
s = _sub(s, 1, width)
|
s = _sub(s, 1, width)
|
||||||
end
|
end
|
||||||
local padding = len < width and _rep(' ', width - len)
|
local padding = len < width and _rep(' ', width - len)
|
||||||
if padding then
|
if padding then
|
||||||
if justify == 'right' then
|
if align == 'right' then
|
||||||
s = padding .. s
|
s = padding .. s
|
||||||
else
|
else
|
||||||
s = s .. padding
|
s = s .. padding
|
||||||
@ -301,7 +301,7 @@ function UI.Grid:drawHeadings()
|
|||||||
end
|
end
|
||||||
sb:write(ind .. col.heading,
|
sb:write(ind .. col.heading,
|
||||||
col.cw + 1,
|
col.cw + 1,
|
||||||
col.justify,
|
col.align,
|
||||||
self.headerBackgroundColor,
|
self.headerBackgroundColor,
|
||||||
color)
|
color)
|
||||||
end
|
end
|
||||||
@ -341,7 +341,7 @@ function UI.Grid:drawRows()
|
|||||||
for _,col in pairs(self.columns) do
|
for _,col in pairs(self.columns) do
|
||||||
sb:write(ind .. safeValue(row[col.key] or ''),
|
sb:write(ind .. safeValue(row[col.key] or ''),
|
||||||
col.cw + 1,
|
col.cw + 1,
|
||||||
col.justify,
|
col.align,
|
||||||
bg,
|
bg,
|
||||||
fg)
|
fg)
|
||||||
ind = ' '
|
ind = ' '
|
||||||
|
Loading…
Reference in New Issue
Block a user