Move to just two panes on mac for now
This commit is contained in:
@ -9,10 +9,11 @@ import Views
|
||||
)
|
||||
@AppStorage(UserDefaultKey.preferredWebLineSpacing.rawValue) var storedLineSpacing = 150
|
||||
@AppStorage(UserDefaultKey.preferredWebMaxWidthPercentage.rawValue) var storedMaxWidthPercentage = 100
|
||||
@AppStorage(UserDefaultKey.enableHighlightOnRelease.rawValue) var enableHighlightOnRelease = false
|
||||
|
||||
@Binding var preferredFont: String
|
||||
@Binding var prefersHighContrastText: Bool
|
||||
@Binding var justifyText: Bool
|
||||
@Binding var currentThemeName: String
|
||||
|
||||
public var fontSizeButtons: some View {
|
||||
Group {
|
||||
@ -85,10 +86,14 @@ import Views
|
||||
|
||||
public init(
|
||||
preferredFont: Binding<String>,
|
||||
prefersHighContrastText: Binding<Bool>
|
||||
prefersHighContrastText: Binding<Bool>,
|
||||
justifyText: Binding<Bool>,
|
||||
currentThemeName: Binding<String>
|
||||
) {
|
||||
self._preferredFont = preferredFont
|
||||
self._prefersHighContrastText = prefersHighContrastText
|
||||
self._justifyText = justifyText
|
||||
self._currentThemeName = currentThemeName
|
||||
}
|
||||
|
||||
public var body: some Commands {
|
||||
@ -111,14 +116,22 @@ import Views
|
||||
}
|
||||
}
|
||||
|
||||
Picker(selection: $currentThemeName, label: Text("Theme")) {
|
||||
ForEach(Theme.allCases, id: \.self) { theme in
|
||||
Text(theme.rawValue).tag(theme.rawValue).tag(theme.rawValue)
|
||||
}
|
||||
}.onChange(of: currentThemeName) { _ in
|
||||
NSNotification.readerSettingsChanged()
|
||||
}
|
||||
|
||||
Toggle(
|
||||
isOn: $prefersHighContrastText,
|
||||
label: { Text(LocalText.genericHighContrastText) }
|
||||
)
|
||||
|
||||
Toggle(
|
||||
isOn: $enableHighlightOnRelease,
|
||||
label: { Text(LocalText.genericHighContrastText) }
|
||||
isOn: $justifyText,
|
||||
label: { Text(LocalText.enableJustifyText) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,6 +35,8 @@ import Views
|
||||
}
|
||||
}
|
||||
List {
|
||||
Spacer(minLength: 10)
|
||||
|
||||
ForEach(viewModel.items) { item in
|
||||
MacFeedCardNavigationLink(
|
||||
item: item,
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
import SwiftUI
|
||||
import Utils
|
||||
import Views
|
||||
|
||||
struct HomeView: View {
|
||||
@StateObject private var viewModel = HomeFeedViewModel()
|
||||
@ -22,6 +24,20 @@ struct HomeView: View {
|
||||
}
|
||||
#elseif os(macOS)
|
||||
HomeFeedView(viewModel: viewModel)
|
||||
.frame(minWidth: 320)
|
||||
.toolbar {
|
||||
ToolbarItem {
|
||||
Button(
|
||||
action: {
|
||||
NSApp.keyWindow?.firstResponder?.tryToPerform(
|
||||
#selector(NSSplitViewController.toggleSidebar(_:)), with: nil
|
||||
)
|
||||
},
|
||||
label: { Label(LocalText.navigationSelectSidebarToggle, systemImage: "sidebar.left") }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,14 +24,7 @@ public struct PrimaryContentView: View {
|
||||
#if os(macOS)
|
||||
private var splitView: some View {
|
||||
NavigationView {
|
||||
// The first column is the sidebar.
|
||||
PrimaryContentSidebar(categories: categories)
|
||||
.navigationTitle("Categories")
|
||||
|
||||
// Second column is the Primary Nav Stack
|
||||
PrimaryContentCategory.feed.destinationView
|
||||
|
||||
// Third column is the detail view
|
||||
Text(LocalText.navigationSelectLink)
|
||||
}
|
||||
.accentColor(.appGrayTextContrast)
|
||||
|
||||
Reference in New Issue
Block a user