From 9beadaadd9e770f6e08ad0d26e88901de7106514 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Thu, 2 Oct 2025 11:42:57 +0200 Subject: [PATCH] Theme - Display an optional picture in Help/About view specified by an URL (config entry ui/theme_about_picture_url) --- Linphone/Core/CorePreferences.swift | 6 +++++ .../UI/Main/Help/Fragments/HelpFragment.swift | 22 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Linphone/Core/CorePreferences.swift b/Linphone/Core/CorePreferences.swift index 825a4f25d..d474afd27 100644 --- a/Linphone/Core/CorePreferences.swift +++ b/Linphone/Core/CorePreferences.swift @@ -188,6 +188,12 @@ class CorePreferences { } } + static var themeAboutPictureUrl: String? { + get { + return Config.get().getString(section: "ui", key: "theme_about_picture_url", defaultString: nil) + } + } + static var darkModeAllowed: Bool { return Config.get().getBool(section: "ui", key: "dark_mode_allowed", defaultValue: true) } diff --git a/Linphone/UI/Main/Help/Fragments/HelpFragment.swift b/Linphone/UI/Main/Help/Fragments/HelpFragment.swift index a50ad77d8..18c55d618 100644 --- a/Linphone/UI/Main/Help/Fragments/HelpFragment.swift +++ b/Linphone/UI/Main/Help/Fragments/HelpFragment.swift @@ -77,11 +77,31 @@ struct HelpFragment: View { ScrollView { VStack(spacing: 0) { VStack(spacing: 20) { + if let urlString = CorePreferences.themeAboutPictureUrl, + let url = URL(string: urlString) { + AsyncImage(url: url) { phase in + switch phase { + case .empty: + ProgressView() + .frame(maxWidth: .infinity, minHeight: 100, maxHeight: 100) + case .success(let image): + image + .resizable() + .scaledToFit() + .frame(maxWidth: .infinity, maxHeight: 100, alignment: .center) + case .failure: + EmptyView() + @unknown default: + EmptyView() + } + } + } else { + EmptyView() + } Text("help_about_title") .default_text_style_800(styleSize: 16) .frame(maxWidth: .infinity, alignment: .leading) .padding(.bottom, 5) - Button { if let url = URL(string: NSLocalizedString("website_user_guide_url", comment: "")) { UIApplication.shared.open(url)