Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions components/home/HomeRows.bs
Original file line number Diff line number Diff line change
Expand Up @@ -148,29 +148,14 @@ sub updateSize()
'Set width of Rows to cut off at edge of Safe Zone
m.top.itemSize = [1703, itemHeight]

' spacing between rows (modern reserves space for the focused card info block)
' Padding arrives as a number value that needs to be scaled from flutter to roku
paddingKey = isModernHomeRows() ? "ui.home.modernRowsPadding" : "ui.home.classicRowsPadding"
padding = Val(m.global.session.user.settings[paddingKey])
if isModernHomeRows()
paddingKey = "ui.home.modernRowsPadding"
compactSpacing = 360
spaciousSpacing = 560
defaultSpacing = 460
verticalSpacing = (padding - 200) * (padding / 360)
else
paddingKey = "ui.home.classicRowsPadding"
compactSpacing = 10
spaciousSpacing = 90
defaultSpacing = 30
verticalSpacing = padding * 2
end if

' Padding arrives as either a pixel value or a named preset
padding = m.global.session.user.settings[paddingKey]
paddingStr = isValid(padding) ? padding.ToStr() : ""
verticalSpacing = Val(paddingStr)
if verticalSpacing <= 0
if isStringEqual(paddingStr, "compact") then verticalSpacing = compactSpacing
if isStringEqual(paddingStr, "spacious") then verticalSpacing = spaciousSpacing
if verticalSpacing <= 0 then verticalSpacing = defaultSpacing
end if

m.top.itemSpacing = [0, verticalSpacing]

' spacing between items in a row. Modern keeps cards tight, the focused card
Expand Down
84 changes: 42 additions & 42 deletions settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,48 +334,6 @@
"type": "bool",
"default": "false"
},
{
"title": "Classic Layout Home Rows Padding",
"description": "Adjust vertical padding between home screen rows in classic layout",
"settingName": "ui.home.classicRowsPadding",
"type": "radio",
"default": "30",
"options": [
{ "title": "10 px", "id": "10" },
{ "title": "20 px", "id": "20" },
{ "title": "30 px (Default)", "id": "30" },
{ "title": "40 px", "id": "40" },
{ "title": "50 px", "id": "50" },
{ "title": "60 px", "id": "60" },
{ "title": "70 px", "id": "70" },
{ "title": "80 px", "id": "80" },
{ "title": "90 px", "id": "90" },
{ "title": "100 px", "id": "100" },
{ "title": "110 px", "id": "110" },
{ "title": "120 px", "id": "120" },
{ "title": "130 px", "id": "130" }
]
},
{
"title": "Modern Layout Home Rows Padding",
"description": "Adjust vertical padding between home screen rows in modern layout",
"settingName": "ui.home.modernRowsPadding",
"type": "radio",
"default": "460",
"options": [
{ "title": "360 px", "id": "360" },
{ "title": "380 px", "id": "380" },
{ "title": "400 px", "id": "400" },
{ "title": "420 px", "id": "420" },
{ "title": "440 px", "id": "440" },
{ "title": "460 px (Default)", "id": "460" },
{ "title": "480 px", "id": "480" },
{ "title": "500 px", "id": "500" },
{ "title": "520 px", "id": "520" },
{ "title": "540 px", "id": "540" },
{ "title": "560 px", "id": "560" }
]
},
{
"title": "Recommendation Engine Source",
"description": "Select the recommendation engine source for home screen recommendations",
Expand Down Expand Up @@ -884,6 +842,48 @@
}
]
},
{
"title": "Classic Layout Home Rows Padding",
"description": "Adjust vertical padding between home screen rows in classic layout",
"settingName": "ui.home.classicRowsPadding",
"type": "radio",
"default": "30",
"options": [
{ "title": "10 px", "id": "10" },
{ "title": "20 px", "id": "20" },
{ "title": "30 px (Default)", "id": "30" },
{ "title": "40 px", "id": "40" },
{ "title": "50 px", "id": "50" },
{ "title": "60 px", "id": "60" },
{ "title": "70 px", "id": "70" },
{ "title": "80 px", "id": "80" },
{ "title": "90 px", "id": "90" },
{ "title": "100 px", "id": "100" },
{ "title": "110 px", "id": "110" },
{ "title": "120 px", "id": "120" },
{ "title": "130 px", "id": "130" }
]
},
{
"title": "Modern Layout Home Rows Padding",
"description": "Adjust vertical padding between home screen rows in modern layout",
"settingName": "ui.home.modernRowsPadding",
"type": "radio",
"default": "460",
"options": [
{ "title": "360 px", "id": "360" },
{ "title": "380 px", "id": "380" },
{ "title": "400 px", "id": "400" },
{ "title": "420 px", "id": "420" },
{ "title": "440 px", "id": "440" },
{ "title": "460 px (Default)", "id": "460" },
{ "title": "480 px", "id": "480" },
{ "title": "500 px", "id": "500" },
{ "title": "520 px", "id": "520" },
{ "title": "540 px", "id": "540" },
{ "title": "560 px", "id": "560" }
]
},
{
"title": "Since You Watched Rows Settings",
"description": "Customize the Since You Watched rows.",
Expand Down