standalone mode: add config options for sizes

This commit is contained in:
Franziska Kunsmann 2024-03-26 12:34:12 +01:00
parent 3bea26972f
commit dad7cbfcfe
2 changed files with 31 additions and 9 deletions

View file

@ -143,5 +143,29 @@
"valid": ["image"],
"default": "empty.png"
}]
}, {
"title": "Standalone Options (IGNORED in scheduled-player)",
"type": "section"
}, {
"title": "Topbar Font Size",
"ui_width": 4,
"name": "standalone_topbar_size",
"type": "integer",
"default": 70,
"hint": "Font size for the header content (clock and day)"
}, {
"title": "Talk Font Size",
"ui_width": 4,
"name": "standalone_talk_size",
"type": "integer",
"default": 50,
"hint": "Font size for talk titles. Room name and speaker names will use 80% of that."
}, {
"title": "Padding",
"ui_width": 4,
"name": "standalone_padding",
"type": "integer",
"default": 20,
"hint": "Padding to the screen edge and between all content"
}]
}

View file

@ -1,14 +1,5 @@
local json = require "json"
local TOPBAR_FONT_SIZE = 70
local TALK_FONT_SIZE = 50
local PADDING = 20
if NATIVE_HEIGHT > 1200 then
TOPBAR_FONT_SIZE = 140
TALK_FONT_SIZE = 100
end
local font_clock
local font_day
local font_room
@ -26,6 +17,9 @@ local show_language = true
local show_track = true
local is_single_day = false
local hide_talks_older_than_minutes = 25
local TOPBAR_FONT_SIZE = 70
local TALK_FONT_SIZE = 50
local PADDING = 20
gl.setup(NATIVE_WIDTH, NATIVE_HEIGHT)
@ -47,6 +41,10 @@ util.file_watch("config.json", function(content)
show_track = config.show_track
hide_talks_older_than_minutes = config.hide_talks_older_than_minutes
TOPBAR_FONT_SIZE = config.standalone_topbar_size
TALK_FONT_SIZE = config.standalone_talk_size
PADDING = config.standalone_padding
font_clock = resource.load_font(config.font_clock.asset_name)
font_day = resource.load_font(config.font_day.asset_name)
font_room = resource.load_font(config.font_room.asset_name)