diff --git a/itemcontroller.lua b/itemcontroller.lua index 0152a50..42b53f6 100644 --- a/itemcontroller.lua +++ b/itemcontroller.lua @@ -406,8 +406,11 @@ local PAGES = { local KEY_BACKSPACE = "backspace" local ID_FILTER_DISPLAY = "display_filter" + local ID_FILTER_PADDING = "display_filter_pad" local KEYBOARD_BG_COLOR = colors.gray local KEYBOARD_KEY_COLOR = colors.gray + local KEYBOARD_FILTER_BG_COLOR = colors.lightGray + local KEYBOARD_FILTER_TEXT_COLOR = colors.red local keyboardLines = { lines = { { backspace = true, "1234567890" }, @@ -463,7 +466,12 @@ local PAGES = { -- TODO: Pad elements properly - table.insert(keyboardLines.elements, 1, Text:new{ id = ID_FILTER_DISPLAY }) + local paddedFilterText = Padding:new{ + id = ID_FILTER_PADDING, + bgColor = KEYBOARD_FILTER_BG_COLOR, + element = Text:new{ id = ID_FILTER_DISPLAY, bgColor = KEYBOARD_FILTER_BG_COLOR, fgColor = KEYBOARD_FILTER_TEXT_COLOR } + } + table.insert(keyboardLines.elements, 1, paddedFilterText) local keyboardList = Padding:new{ bgColor = KEYBOARD_BG_COLOR, left = KEYBOARD_HPAD, right = KEYBOARD_HPAD, element = List:new{ bgColor = KEYBOARD_BG_COLOR, @@ -543,7 +551,11 @@ local PAGES = { local filterDisplayedText = fitText(pageState.filter, keyboardList:getWidth() - 2) local filterText = keyboardList:findById(ID_FILTER_DISPLAY) filterText:setText(filterDisplayedText) - filterText:setX(1) + + local filterPadding = keyboardLines:findById(ID_FILTER_PADDING) + filterPadding:setPadding{ + right = keyboardLines:getWidth() - filterText:getWidth() + } keyboardList:setVisible(pageState.displayKeyboard)