Fix macOS bug where the navigation title interferes with back button
This commit is contained in:
@@ -9,51 +9,54 @@ import SwiftUI
|
|||||||
|
|
||||||
struct MainView: View {
|
struct MainView: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
NavigationStack {
|
||||||
NavigationStack {
|
Image("bigicon").resizable().frame(width: 150.0, height: 150.0)
|
||||||
Image("bigicon").resizable().frame(width: 150.0, height: 150.0)
|
Text("Nostash").font(.title)
|
||||||
Text("Nostash").font(.title)
|
Text("A Safari Nostr Extension").font(.title2)
|
||||||
Text("A Safari Nostr Extension").font(.title2)
|
NavigationLink("Privacy Policy") {
|
||||||
NavigationLink("Privacy Policy") {
|
PrivacyPolicyView()
|
||||||
PrivacyPolicyView()
|
|
||||||
}
|
|
||||||
#if macOS
|
|
||||||
.buttonStyle(.link)
|
|
||||||
#endif
|
|
||||||
.padding(.all, 3.0)
|
|
||||||
|
|
||||||
NavigationLink("Getting Started: iPhone") {
|
|
||||||
GettingStartediPhone()
|
|
||||||
}
|
|
||||||
#if macOS
|
|
||||||
.buttonStyle(.link)
|
|
||||||
#endif
|
|
||||||
.padding(.all, 3.0)
|
|
||||||
|
|
||||||
NavigationLink("Getting Started: iPad") {
|
|
||||||
GettingStartediPad()
|
|
||||||
}
|
|
||||||
#if macOS
|
|
||||||
.buttonStyle(.link)
|
|
||||||
#endif
|
|
||||||
.padding(.all, 3.0)
|
|
||||||
|
|
||||||
NavigationLink("Getting Started: Mac") {
|
|
||||||
GettingStartedMac()
|
|
||||||
}
|
|
||||||
#if macOS
|
|
||||||
.buttonStyle(.link)
|
|
||||||
#endif
|
|
||||||
.padding(.all, 3.0)
|
|
||||||
|
|
||||||
NavigationLink("Tips and Tricks") {
|
|
||||||
TipsAndTricks()
|
|
||||||
}
|
|
||||||
#if macOS
|
|
||||||
.buttonStyle(.link)
|
|
||||||
#endif
|
|
||||||
.padding(.all, 3.0)
|
|
||||||
}
|
}
|
||||||
|
#if os(macOS)
|
||||||
|
.buttonStyle(.link)
|
||||||
|
#endif
|
||||||
|
.padding(.all, 3.0)
|
||||||
|
|
||||||
|
NavigationLink("Getting Started: iPhone") {
|
||||||
|
GettingStartediPhone()
|
||||||
|
}
|
||||||
|
#if os(macOS)
|
||||||
|
.buttonStyle(.link)
|
||||||
|
#endif
|
||||||
|
.padding(.all, 3.0)
|
||||||
|
|
||||||
|
NavigationLink("Getting Started: iPad") {
|
||||||
|
GettingStartediPad()
|
||||||
|
}
|
||||||
|
#if os(macOS)
|
||||||
|
.buttonStyle(.link)
|
||||||
|
#endif
|
||||||
|
.padding(.all, 3.0)
|
||||||
|
|
||||||
|
NavigationLink("Getting Started: Mac") {
|
||||||
|
GettingStartedMac()
|
||||||
|
}
|
||||||
|
#if os(macOS)
|
||||||
|
.buttonStyle(.link)
|
||||||
|
#endif
|
||||||
|
.padding(.all, 3.0)
|
||||||
|
|
||||||
|
NavigationLink("Tips and Tricks") {
|
||||||
|
TipsAndTricks()
|
||||||
|
}
|
||||||
|
#if os(macOS)
|
||||||
|
.buttonStyle(.link)
|
||||||
|
#endif
|
||||||
|
.padding(.all, 3.0)
|
||||||
|
}
|
||||||
|
.toolbar {
|
||||||
|
// There is a macOS bug where the back button overlaps the title in the navigation bar.
|
||||||
|
// Adding an empty Text element fixes the issue apparently.
|
||||||
|
Text("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import SwiftUI
|
|||||||
@main
|
@main
|
||||||
struct NostashApp: App {
|
struct NostashApp: App {
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup("Nostash") {
|
WindowGroup {
|
||||||
MainView()
|
MainView()
|
||||||
}
|
}
|
||||||
#if macOS
|
#if os(macOS)
|
||||||
.defaultSize(width: 400, height: 500)
|
.defaultSize(width: 400, height: 500)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user