Fix filter text display
This commit is contained in:
parent
e788002b37
commit
f533382022
@ -463,7 +463,7 @@ local PAGES = {
|
|||||||
|
|
||||||
table.insert(keyboardLines.elements, 1, Text:new{ id = ID_FILTER_DISPLAY })
|
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,
|
bgColor = colors.cyan,
|
||||||
[Orientation:getId()] = Orientation.VERTICAL,
|
[Orientation:getId()] = Orientation.VERTICAL,
|
||||||
[Children:getId()] = keyboardLines.elements
|
[Children:getId()] = keyboardLines.elements
|
||||||
@ -538,10 +538,10 @@ local PAGES = {
|
|||||||
local keyboardWidth = keyboardList:getWidth()
|
local keyboardWidth = keyboardList:getWidth()
|
||||||
keyboardList:setPos(math.floor((screenContainer:getWidth() - keyboardWidth) / 2), screenContainer:getHeight() - keyboardList:getHeight() - bottomBarList:getHeight())
|
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)
|
local filterText = keyboardList:findById(ID_FILTER_DISPLAY)
|
||||||
filterText:setText(filterDisplayedText)
|
filterText:setText(filterDisplayedText)
|
||||||
filterText:setX(math.floor((keyboardWidth - #filterDisplayedText) / 2))
|
filterText:setX(1)
|
||||||
|
|
||||||
keyboardList:setVisible(pageState.displayKeyboard)
|
keyboardList:setVisible(pageState.displayKeyboard)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user