From 0e564fd943b589d4dec230be8efae711433f2f00 Mon Sep 17 00:00:00 2001 From: scyc314 Date: Tue, 10 Feb 2026 00:36:23 -0600 Subject: [PATCH 1/2] scoreboard format and history fixes --- .../Scoreboard/ScoreboardEffectModularView.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Moblin/VideoEffects/Scoreboard/ScoreboardEffectModularView.swift b/Moblin/VideoEffects/Scoreboard/ScoreboardEffectModularView.swift index fc8268f63..00559b59b 100644 --- a/Moblin/VideoEffects/Scoreboard/ScoreboardEffectModularView.swift +++ b/Moblin/VideoEffects/Scoreboard/ScoreboardEffectModularView.swift @@ -24,9 +24,9 @@ struct ScoreboardEffectModularView: View { private func calculateMaxHistory() -> Int { var maxHistory = 0 for indexPlusOne in 1 ... 5 { - let homeHas = getHistoricScore(team: config.team1, indexPlusOne: indexPlusOne) != nil - let awayHas = getHistoricScore(team: config.team2, indexPlusOne: indexPlusOne) != nil - if homeHas || awayHas { + let homeHas = getHistoricScore(team: config.team1, indexPlusOne: indexPlusOne) ?? "" + let awayHas = getHistoricScore(team: config.team2, indexPlusOne: indexPlusOne) ?? "" + if !homeHas.isEmpty || !awayHas.isEmpty { maxHistory = indexPlusOne } } @@ -59,7 +59,7 @@ struct ScoreboardEffectModularView: View { histWidth: histWidth ) } - .frame(width: CGFloat(modular.width) + CGFloat(maxHistory) * histWidth) + .frame(width: CGFloat(modular.width) + CGFloat(maxHistory - 1) * histWidth) infoBox() } } @@ -196,7 +196,7 @@ struct ScoreboardEffectModularView: View { ) } teamName(team: modularTeam) - .padding(.leading, 3) + .padding(.leading, 8) .frame(maxWidth: .infinity, alignment: .leading) possession(show: team.possession) if modular.layout == .stackedInline { @@ -274,7 +274,7 @@ struct ScoreboardEffectModularView: View { fontSize: CGFloat, width: CGFloat, gray: Bool, - weight: Font.Weight = .bold + weight: Font.Weight = .heavy ) -> some View { if !value.isEmpty { ZStack { @@ -309,7 +309,7 @@ struct ScoreboardEffectModularView: View { private func teamName(team: SettingsWidgetModularScoreboardTeam) -> some View { Text(team.name) - .font(.system(size: fontSize())) + .font(.system(size: fontSize(), weight: .bold)) .bold(modular.isBold) .lineLimit(1) .minimumScaleFactor(0.1) From 679da342ab89a22376f71cee8f395b7a93416e2f Mon Sep 17 00:00:00 2001 From: scyc314 Date: Tue, 10 Feb 2026 16:36:51 -0600 Subject: [PATCH 2/2] scoreboard width fix --- .../Scoreboard/ScoreboardEffectModularView.swift | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Moblin/VideoEffects/Scoreboard/ScoreboardEffectModularView.swift b/Moblin/VideoEffects/Scoreboard/ScoreboardEffectModularView.swift index 00559b59b..bdecbd46e 100644 --- a/Moblin/VideoEffects/Scoreboard/ScoreboardEffectModularView.swift +++ b/Moblin/VideoEffects/Scoreboard/ScoreboardEffectModularView.swift @@ -43,6 +43,9 @@ struct ScoreboardEffectModularView: View { HStack(alignment: .top, spacing: 0) { let maxHistory = calculateMaxHistory() let histWidth = modular.fontSize() * 1.5 + let secondaryBoxWidth = fontSize() * 1.55 + let dynamicWidth = CGFloat(modular.width) - CGFloat(secondaryBoxWidth) + CGFloat(maxHistory) * + CGFloat(histWidth) VStack(spacing: 0) { stackedHistoryTeam( team: config.team1, @@ -59,7 +62,8 @@ struct ScoreboardEffectModularView: View { histWidth: histWidth ) } - .frame(width: CGFloat(modular.width) + CGFloat(maxHistory - 1) * histWidth) + .frame(width: dynamicWidth) + // .frame(width: CGFloat(modular.width) + CGFloat(maxHistory - 1) * histWidth) infoBox() } } @@ -76,7 +80,7 @@ struct ScoreboardEffectModularView: View { let height = CGFloat(modular.rowHeight) HStack(spacing: 0) { teamName(team: modularTeam) - .padding(.leading, 6) + .padding(.leading, 8) .padding(.trailing, 2) .frame(maxWidth: .infinity, alignment: .leading) possession(show: team.possession) @@ -284,10 +288,13 @@ struct ScoreboardEffectModularView: View { if let label, !label.isEmpty { VStack(spacing: -2) { Text(label) - .font(.system(size: fontSize * 0.25, weight: .bold)) + .font(.system(size: fontSize * 0.25)) .offset(x: 0, y: fontSize * 0.04) Text(value) - .font(.system(size: fontSize * 0.75, weight: weight)) + .font(.system( + size: fontSize * 0.75, + weight: weight + )) // the bold toggle doesn't seem to impact the team name } } else { Text(value)