Simplify layout setup
This commit is contained in:
parent
82e0044ba0
commit
2e622295b8
@ -499,8 +499,6 @@ local PAGES = {
|
|||||||
id = "data_divider",
|
id = "data_divider",
|
||||||
top = 0,
|
top = 0,
|
||||||
bottom = 0,
|
bottom = 0,
|
||||||
left = math.floor((state.width - (PADDING_RQC_H * 2) - #tostring(pageState.request) - #tostring(group:getItemCount())) / 2),
|
|
||||||
right = math.ceil((state.width - (PADDING_RQC_H * 2) - #tostring(pageState.request) - #tostring(group:getItemCount())) / 2),
|
|
||||||
element = Text:new{ text = "/" }
|
element = Text:new{ text = "/" }
|
||||||
},
|
},
|
||||||
Text:new{ id = "data_available", text = tostring(group:getItemCount()) },
|
Text:new{ id = "data_available", text = tostring(group:getItemCount()) },
|
||||||
@ -557,12 +555,15 @@ local PAGES = {
|
|||||||
local dataAvailableText = paddedRequestCount:findById("data_available")
|
local dataAvailableText = paddedRequestCount:findById("data_available")
|
||||||
local requestCapProgress = paddedRequestCount:findById("request_capacity")
|
local requestCapProgress = paddedRequestCount:findById("request_capacity")
|
||||||
|
|
||||||
dataRequestText:setText(tostring(pageState.request))
|
local requestText = tostring(pageState.request)
|
||||||
|
local availableText = tostring(group:getItemCount())
|
||||||
|
|
||||||
|
dataRequestText:setText(requestText)
|
||||||
dataDividerPad:setPadding{
|
dataDividerPad:setPadding{
|
||||||
left = math.floor((state.width - (PADDING_RQC_H * 2) - #tostring(pageState.request) - #tostring(group:getItemCount())) / 2),
|
left = math.ceil((state.width - 1 - (PADDING_RQC_H * 2) - #requestText - #availableText) / 2),
|
||||||
right = math.ceil((state.width - (PADDING_RQC_H * 2) - #tostring(pageState.request) - #tostring(group:getItemCount())) / 2)
|
right = math.floor((state.width - 1 - (PADDING_RQC_H * 2) - #requestText - #availableText) / 2)
|
||||||
}
|
}
|
||||||
dataAvailableText:setText(tostring(group:getItemCount()))
|
dataAvailableText:setText(availableText)
|
||||||
requestCapProgress:setProgress(pageState.request / group:getItemCount())
|
requestCapProgress:setProgress(pageState.request / group:getItemCount())
|
||||||
|
|
||||||
stuffContainer:setDirty(true)
|
stuffContainer:setDirty(true)
|
||||||
@ -585,6 +586,8 @@ local PAGES = {
|
|||||||
bindRequestButton(1)
|
bindRequestButton(1)
|
||||||
bindRequestButton(5)
|
bindRequestButton(5)
|
||||||
|
|
||||||
|
updateDisplayState()
|
||||||
|
|
||||||
return renderDefault(state, stuffContainer)
|
return renderDefault(state, stuffContainer)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user