Skip to content

Commit

Permalink
Merge pull request #277 from AvdLee/feature/settings-view
Browse files Browse the repository at this point in the history
Improve macOS Settings View
  • Loading branch information
kean committed Jul 1, 2024
2 parents 895fb6f + 742955b commit 1e81495
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/PulseUI/Features/Console/ConsoleView-macos.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions Sources/PulseUI/Features/Settings/SettingsView-macos.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import SwiftUI
import Pulse

@available(macOS 13, *)
struct SettingsView: View {
@State private var isPresentingShareStoreView = false
@State private var shareItems: ShareItems?
Expand All @@ -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") {
Expand All @@ -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()
Expand Down

0 comments on commit 1e81495

Please sign in to comment.