Fix filter text display

This commit is contained in:
Gabriel Tofvesson 2024-10-26 00:11:04 +02:00
parent e788002b37
commit f533382022

View File

@ -463,7 +463,7 @@ local PAGES = {
table.insert(keyboardLines.elements, 1, Text:new{ id = ID_FILTER_DISPLAY })
local keyboardList = Padding:new{ bgColor = colors.cyan, left = KEYBOARD_HPAD, right = KEYBOARD_HPAD, element = List:new{
local keyboardList = Padding:new{ bgColor = colors.gray, left = KEYBOARD_HPAD, right = KEYBOARD_HPAD, element = List:new{
bgColor = colors.cyan,
[Orientation:getId()] = Orientation.VERTICAL,
[Children:getId()] = keyboardLines.elements
@ -538,10 +538,10 @@ local PAGES = {
local keyboardWidth = keyboardList:getWidth()
keyboardList:setPos(math.floor((screenContainer:getWidth() - keyboardWidth) / 2), screenContainer:getHeight() - keyboardList:getHeight() - bottomBarList:getHeight())
local filterDisplayedText = #pageState.filter < keyboardWidth and pageState.filter or pageState.filter:sub(#pageState.filter - keyboardWidth + 1)
local filterDisplayedText = fitText(pageState.filter, keyboardList:getWidth() - 2)
local filterText = keyboardList:findById(ID_FILTER_DISPLAY)
filterText:setText(filterDisplayedText)
filterText:setX(math.floor((keyboardWidth - #filterDisplayedText) / 2))
filterText:setX(1)
keyboardList:setVisible(pageState.displayKeyboard)