Compare commits

..

No commits in common. "31f53ef5216a656a59b0260f4f70f619d3353835" and "25a998a5427dac3e8e4e1ae318c58e827c10d04b" have entirely different histories.

2 changed files with 11 additions and 32 deletions

View File

@ -22,7 +22,4 @@ function Orientation:with(elementType)
return elementType return elementType
end end
Orientation.VERTICAL = true
Orientation.HORIZONTAL = false
return Orientation return Orientation

View File

@ -132,7 +132,7 @@ local function itemList(groups, wBudget, hBudget, savedState, onClick, setPage,
padImport, padImport,
padNext padNext
}, },
[Orientation:getId()] = Orientation.HORIZONTAL [Orientation:getId()] = false
} }
local bgColors = { local bgColors = {
@ -179,7 +179,7 @@ local function itemList(groups, wBudget, hBudget, savedState, onClick, setPage,
paddedText, paddedText,
countLabel countLabel
}, },
[Orientation:getId()] = Orientation.HORIZONTAL, [Orientation:getId()] = false,
onClick = onClick and function(element, x, y, source) onClick = onClick and function(element, x, y, source)
return onClick(element, x, y, source, group) return onClick(element, x, y, source, group)
end or nil end or nil
@ -196,7 +196,7 @@ local function itemList(groups, wBudget, hBudget, savedState, onClick, setPage,
return List:new{ return List:new{
[Children:getId()] = entries, [Children:getId()] = entries,
[Orientation:getId()] = Orientation.VERTICAL [Orientation:getId()] = true
}, state }, state
end end
@ -297,7 +297,10 @@ local PAGES = {
end end
local title = Text:new{ local title = Text:new{
text = "Detail: "..group:getSimpleName(), text = "Detail: "..group:getSimpleName(),
bgColor = colors.gray parent = state.monitor,
onClick = function(e, x, y, s)
state:setPage("MAIN")
end
} }
local paddedTitle = Padding:new{ local paddedTitle = Padding:new{
@ -305,37 +308,16 @@ local PAGES = {
left = 1, left = 1,
right = 1, right = 1,
bottom = 1, bottom = 1,
element = title, element = title
bgColor = colors.gray
} }
local itemCount = Text:new{
text = "Count: "..tostring(group:getItemCount()),
}
local itemSlots = Text:new{
text = "Slots: "..tostring(group:getStackCount())
}
local infoElements = List:new{
[Children:getId()] = {
paddedTitle,
itemCount,
itemSlots
},
[Orientation:getId()] = Orientation.VERTICAL,
width = state.width
}
local stuffContainer = Container:new{ local stuffContainer = Container:new{
[Children:getId()] = { [Children:getId()] = {
infoElements paddedTitle
}, },
width = state.width, width = state.width,
height = state.height, height = state.height,
parent = state.monitor, parent = state.monitor
onClick = function(e, x, y, s)
state:setPage("MAIN")
end
} }
return renderDefault(state, stuffContainer) return renderDefault(state, stuffContainer)