1
0
mirror of https://github.com/kepler155c/opus synced 2025-11-18 00:05:12 +00:00

spaces->tabs + cleanup + pathing fixes

This commit is contained in:
kepler155c@gmail.com
2019-06-18 15:19:24 -04:00
parent 82ec4db50f
commit 3c22a872b0
37 changed files with 1948 additions and 1703 deletions

View File

@@ -329,23 +329,13 @@ function UI.Grid:drawRows()
local rawRow = self.values[key]
local row = self:getDisplayValues(rawRow, key)
local ind = ' '
if self.focused and index == self.index and not self.inactive then
ind = self.focusIndicator
end
local selected = index == self.index and not self.inactive
local bg = self:getRowBackgroundColor(rawRow, selected)
local fg = self:getRowTextColor(rawRow, selected)
local focused = self.focused and selected
self:drawRow(sb, row, focused, bg, fg)
for _,col in pairs(self.columns) do
sb:write(ind .. safeValue(row[col.key] or ''),
col.cw + 1,
col.align,
bg,
fg)
ind = ' '
end
sb:finish(bg)
end
@@ -354,6 +344,19 @@ function UI.Grid:drawRows()
end
end
function UI.Grid:drawRow(sb, row, focused, bg, fg)
local ind = focused and self.focusIndicator or ' '
for _,col in pairs(self.columns) do
sb:write(ind .. safeValue(row[col.key] or ''),
col.cw + 1,
col.align,
bg,
fg)
ind = ' '
end
end
function UI.Grid:getRowTextColor(row, selected)
if selected then
if self.focused then