Fix action spacing
This commit is contained in:
parent
c18ee0e1f8
commit
04be409a29
@ -419,7 +419,7 @@ local PAGES = {
|
||||
local ACTION_SPACING = 0
|
||||
|
||||
local actions = {
|
||||
tabActionList(ACTION_INTERVAL, ACTION_COUNT, 1, ACTION_SPACING),
|
||||
tabActionList(ACTION_INTERVAL, ACTION_COUNT, -1, ACTION_SPACING),
|
||||
List:new {
|
||||
[Orientation:getId()] = Orientation.HORIZONTAL,
|
||||
[Children:getId()] = {
|
||||
@ -430,31 +430,33 @@ local PAGES = {
|
||||
sortButton
|
||||
}
|
||||
},
|
||||
tabActionList(ACTION_INTERVAL, ACTION_COUNT, -1, ACTION_SPACING)
|
||||
tabActionList(ACTION_INTERVAL, ACTION_COUNT, 1, ACTION_SPACING)
|
||||
}
|
||||
|
||||
for i=#actions+1,1,-1 do
|
||||
table.insert(actions, i, Element:new{ width = 0, height = 0 })
|
||||
end
|
||||
|
||||
local function calculateActionSpaces()
|
||||
local freeSpace = 0
|
||||
for i=2,#actions,2 do
|
||||
freeSpace = freeSpace + actions[i]:getWidth()
|
||||
end
|
||||
local asymmetry = freeSpace % ((#actions - 1) / 2)
|
||||
local part = (freeSpace - asymmetry) / ((#actions + 1) / 2)
|
||||
for i=1,#actions,2 do
|
||||
actions[i]:setWidth((i <= asymmetry and 1 or 0) + part)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local bottomBarList = List:new {
|
||||
[Orientation:getId()] = Orientation.HORIZONTAL,
|
||||
[Children:getId()] = actions
|
||||
}
|
||||
|
||||
local function calculateActionSpaces()
|
||||
local usedSpace = 0
|
||||
for i=2,#actions,2 do
|
||||
usedSpace = usedSpace + actions[i]:getWidth()
|
||||
end
|
||||
local barWidth = bottomBarList:getWidth()
|
||||
local freeSpace = barWidth - usedSpace
|
||||
local asymmetry = freeSpace % ((#actions + 1) / 2)
|
||||
local part = (freeSpace - asymmetry) / ((#actions + 1) / 2)
|
||||
for i=1,#actions,2 do
|
||||
actions[i]:setWidth((i <= asymmetry and 1 or 0) + part)
|
||||
end
|
||||
bottomBarList:_reload()
|
||||
end
|
||||
|
||||
|
||||
local aboveEntries = { storageSatProgress }
|
||||
local belowEntries = { bottomBarList }
|
||||
|
Loading…
x
Reference in New Issue
Block a user