Show app icon and version at bottom of macOS settings sidebar

This commit is contained in:
Arkadiusz Fal
2026-04-22 23:09:17 +02:00
parent 6e91069ff3
commit 29c67d3276
3 changed files with 271 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ struct SettingsView: View {
var body: some View {
#if os(macOS)
macOSSettings
.frame(minWidth: 600, minHeight: 400)
.frame(minWidth: 600, minHeight: 520)
#elseif os(tvOS)
tvOSSettings
#else
@@ -33,11 +33,16 @@ struct SettingsView: View {
#if os(macOS)
private var macOSSettings: some View {
NavigationSplitView {
List(SettingsSection.allCases, selection: $selectedSection) { section in
Label(section.title, systemImage: section.icon)
.tag(section)
VStack(spacing: 0) {
List(SettingsSection.allCases, selection: $selectedSection) { section in
Label(section.title, systemImage: section.icon)
.tag(section)
}
.listStyle(.sidebar)
Divider()
macOSSidebarFooter
}
.listStyle(.sidebar)
.navigationSplitViewColumnWidth(min: 180, ideal: 200)
} detail: {
if appEnvironment != nil {
@@ -75,6 +80,27 @@ struct SettingsView: View {
}
}
}
private var macOSSidebarFooter: some View {
VStack(spacing: 6) {
Image("AppIconPreview")
.resizable()
.scaledToFit()
.frame(width: 48, height: 48)
.clipShape(RoundedRectangle(cornerRadius: 10))
Text(verbatim: "Yattee")
.font(.callout)
.fontWeight(.semibold)
Text("\(appVersion) (\(buildNumber))")
.font(.caption)
.foregroundStyle(.secondary)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 12)
.allowsHitTesting(false)
}
#endif
// MARK: - tvOS Settings

View File

@@ -302,7 +302,7 @@ struct YatteeApp: App {
Window(String(localized: "menu.app.settings"), id: "settings") {
SettingsView(showCloseButton: false)
.appEnvironment(appEnvironment)
.frame(minWidth: 600, idealWidth: 900, maxWidth: .infinity, minHeight: 400, idealHeight: 600, maxHeight: .infinity)
.frame(minWidth: 600, idealWidth: 900, maxWidth: .infinity, minHeight: 520, idealHeight: 600, maxHeight: .infinity)
}
.windowResizability(.contentMinSize)
.defaultSize(width: 900, height: 600)