From 742955bca723601589130c64d189c2205d69d840 Mon Sep 17 00:00:00 2001 From: Antoine van der Lee <4329185+AvdLee@users.noreply.github.com> Date: Mon, 1 Jul 2024 13:30:42 +0200 Subject: [PATCH] Update styling of Settings View popover on Mac --- Sources/PulseUI/Features/Console/ConsoleView-macos.swift | 4 ++-- .../PulseUI/Features/Settings/SettingsView-macos.swift | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Sources/PulseUI/Features/Console/ConsoleView-macos.swift b/Sources/PulseUI/Features/Console/ConsoleView-macos.swift index 44613315f..7a210ec52 100644 --- a/Sources/PulseUI/Features/Console/ConsoleView-macos.swift +++ b/Sources/PulseUI/Features/Console/ConsoleView-macos.swift @@ -75,8 +75,8 @@ private struct ConsoleMainView: View { Label("Show Settings", systemImage: "gearshape") } .help("Show Settings") - .popover(isPresented: $isShowingSettings) { - SettingsView().frame(width: 300, height: 420) + .popover(isPresented: $isShowingSettings, arrowEdge: .bottom) { + SettingsView().frame(width: 300, height: environment.configuration.allowRemoteLogging ? 420 : 175) } } } diff --git a/Sources/PulseUI/Features/Settings/SettingsView-macos.swift b/Sources/PulseUI/Features/Settings/SettingsView-macos.swift index 7409e3533..b9aa03be4 100644 --- a/Sources/PulseUI/Features/Settings/SettingsView-macos.swift +++ b/Sources/PulseUI/Features/Settings/SettingsView-macos.swift @@ -7,6 +7,7 @@ import SwiftUI import Pulse +@available(macOS 13, *) struct SettingsView: View { @State private var isPresentingShareStoreView = false @State private var shareItems: ShareItems? @@ -24,11 +25,14 @@ struct SettingsView: View { .foregroundColor(.secondary) } } - Section(header: Text("Store")) { + Section { if #available(macOS 13, *), let info = try? store.info() { LoggerStoreSizeChart(info: info, sizeLimit: store.configuration.sizeLimit) } + } header: { + PlainListSectionHeaderSeparator(title: "Store") } + Section { HStack { Button("Show in Finder") { @@ -41,13 +45,14 @@ struct SettingsView: View { } } } - } + }.listStyle(.sidebar).scrollContentBackground(.hidden) } } // MARK: - Preview #if DEBUG +@available(macOS 13, *) struct UserSettingsView_Previews: PreviewProvider { static var previews: some View { SettingsView()