bugfixes + tweaks for editor 2.0

This commit is contained in:
kepler155c@gmail.com
2020-04-02 21:28:42 -06:00
parent fc1a308193
commit d88ef00652
9 changed files with 47 additions and 23 deletions

View File

@@ -23,6 +23,7 @@ UI.TextEntry.defaults = {
focused = false,
textColor = colors.white,
shadowTextColor = colors.gray,
markBackgroundColor = colors.gray,
backgroundColor = colors.black, -- colors.lightGray,
backgroundFocusColor = colors.black, --lightGray,
height = 1,
@@ -84,7 +85,7 @@ function UI.TextEntry:draw()
end
if tx ~= tex then
self:write(tx + 2, 1, text:sub(tx + 1, tex), colors.gray, tc)
self:write(tx + 2, 1, text:sub(tx + 1, tex), self.markBackgroundColor, tc)
end
end
if self.focused then
@@ -105,6 +106,10 @@ function UI.TextEntry:updateCursor()
self:setCursorPos(self.entry.pos - self.entry.scroll + 2, 1)
end
function UI.TextEntry:markAll()
self.entry:markAll()
end
function UI.TextEntry:focus()
self:draw()
if self.focused then