Base bottomBar width on state max width
This commit is contained in:
parent
6f606d3758
commit
ab65943ee0
@ -10,7 +10,7 @@ local Element = require("gfx.element")
|
||||
local Progress = require("gfx.progress")
|
||||
local Prop = require("gfx.prop")
|
||||
local Children = require("gfx.prop.children")
|
||||
local Visibility = require("gfx.prop.visibility")
|
||||
--local Visibility = require("gfx.prop.visibility")
|
||||
local Orientation = require("gfx.prop.orientation")
|
||||
|
||||
|
||||
@ -232,6 +232,7 @@ local function renderDefault(state, rootElement)
|
||||
|
||||
-- Trigger re-render
|
||||
rootElement:setDirty(true)
|
||||
rootElement:_reload()
|
||||
end
|
||||
end
|
||||
|
||||
@ -266,7 +267,7 @@ local PAGES = {
|
||||
local pageState = state:currentPageState({
|
||||
sortMode = 1,
|
||||
filter = "",
|
||||
displayKeyboard = Visibility.INVISIBLE,
|
||||
displayKeyboard = true,
|
||||
currentPage = 1
|
||||
})
|
||||
|
||||
@ -434,7 +435,7 @@ local PAGES = {
|
||||
}
|
||||
|
||||
for i=#actions+1,1,-1 do
|
||||
table.insert(actions, i, Element:new{ width = 0, height = 1 })
|
||||
table.insert(actions, i, Element:new{ width = 0 })
|
||||
end
|
||||
|
||||
local bottomBarList = List:new {
|
||||
@ -452,7 +453,7 @@ local PAGES = {
|
||||
usedSpace = usedSpace + actions[i]:getWidth()
|
||||
end
|
||||
|
||||
local barWidth = bottomBarList:getWidth()
|
||||
local barWidth = state.width
|
||||
local freeSpace = barWidth - usedSpace
|
||||
local asymmetry = freeSpace % ((#actions + 1) / 2)
|
||||
local part = (freeSpace - asymmetry) / ((#actions + 1) / 2)
|
||||
@ -488,26 +489,22 @@ local PAGES = {
|
||||
local bgColor = (i % 2 == 0) and colors.gray or colors.black
|
||||
table.insert(
|
||||
entries,
|
||||
Prop.attach(
|
||||
List:new{
|
||||
id = tostring(i),
|
||||
bgColor = bgColor,
|
||||
[Orientation:getId()] = Orientation.HORIZONTAL,
|
||||
[Children:getId()] = {
|
||||
Padding:new{
|
||||
id = GroupEntryID.PADDING,
|
||||
bgColor = bgColor,
|
||||
element = Text:new{ id = GroupEntryID.NAME, bgColor = bgColor }
|
||||
},
|
||||
Text:new{
|
||||
id = GroupEntryID.COUNT,
|
||||
bgColor = bgColor
|
||||
}
|
||||
List:new{
|
||||
id = tostring(i),
|
||||
bgColor = bgColor,
|
||||
[Orientation:getId()] = Orientation.HORIZONTAL,
|
||||
[Children:getId()] = {
|
||||
Padding:new{
|
||||
id = GroupEntryID.PADDING,
|
||||
bgColor = bgColor,
|
||||
element = Text:new{ id = GroupEntryID.NAME, bgColor = bgColor }
|
||||
},
|
||||
Text:new{
|
||||
id = GroupEntryID.COUNT,
|
||||
bgColor = bgColor
|
||||
}
|
||||
},
|
||||
Visibility,
|
||||
Visibility.INVISIBLE
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
@ -566,7 +563,7 @@ local PAGES = {
|
||||
table.insert(keyboardLines.elements, keyLineList)
|
||||
end
|
||||
|
||||
table.insert(keyboardLines.elements, 1, Text:new{ id = ID_FILTER_DISPLAY, text = "" })
|
||||
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{
|
||||
[Orientation:getId()] = Orientation.Vertical,
|
||||
@ -576,7 +573,7 @@ local PAGES = {
|
||||
local screenContainer = Container:new{
|
||||
[Children:getId()] = {
|
||||
mainList,
|
||||
Prop.attach(keyboardList, Visibility, pageState.displayKeyboard)
|
||||
keyboardList
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user