mirror of
https://github.com/kkebo/DNSecure.git
synced 2026-03-11 08:54:36 +00:00
feat: revive "Instructions" row when the app is not active and its layout is a single column
This commit is contained in:
parent
c8015a381d
commit
29adf98043
1 changed files with 14 additions and 2 deletions
|
|
@ -180,6 +180,9 @@ extension ContentView: View {
|
||||||
private var modernBody: some View {
|
private var modernBody: some View {
|
||||||
NavigationSplitView {
|
NavigationSplitView {
|
||||||
List(selection: self.$selection) {
|
List(selection: self.$selection) {
|
||||||
|
if !self.isActivated && self.hSizeClass == .compact {
|
||||||
|
NavigationLink("Instructions", value: -1)
|
||||||
|
}
|
||||||
Section("Servers") {
|
Section("Servers") {
|
||||||
ForEach(0..<self.servers.count, id: \.self) { i in
|
ForEach(0..<self.servers.count, id: \.self) { i in
|
||||||
NavigationLink(value: i) {
|
NavigationLink(value: i) {
|
||||||
|
|
@ -221,7 +224,7 @@ extension ContentView: View {
|
||||||
// Workaround for https://github.com/kkebo/DNSecure/issues/139
|
// Workaround for https://github.com/kkebo/DNSecure/issues/139
|
||||||
.environment(\.editMode, self.$detailEditMode)
|
.environment(\.editMode, self.$detailEditMode)
|
||||||
#endif
|
#endif
|
||||||
} else if !self.isActivated {
|
} else if !self.isActivated || self.selection == -1 {
|
||||||
HowToActivateView()
|
HowToActivateView()
|
||||||
.navigationBarTitleDisplayMode(self.navigationBarTitleDisplayMode)
|
.navigationBarTitleDisplayMode(self.navigationBarTitleDisplayMode)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -244,6 +247,15 @@ extension ContentView: View {
|
||||||
private var legacyBody: some View {
|
private var legacyBody: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
List {
|
List {
|
||||||
|
if !self.isActivated && self.hSizeClass == .compact {
|
||||||
|
NavigationLink(
|
||||||
|
"Instructions",
|
||||||
|
tag: -1,
|
||||||
|
selection: self.$selection
|
||||||
|
) {
|
||||||
|
HowToActivateView()
|
||||||
|
}
|
||||||
|
}
|
||||||
Section("Servers") {
|
Section("Servers") {
|
||||||
ForEach(0..<self.servers.count, id: \.self) { i in
|
ForEach(0..<self.servers.count, id: \.self) { i in
|
||||||
if self.hSizeClass == .compact {
|
if self.hSizeClass == .compact {
|
||||||
|
|
@ -277,7 +289,7 @@ extension ContentView: View {
|
||||||
|
|
||||||
if let i = self.selection, i >= 0 {
|
if let i = self.selection, i >= 0 {
|
||||||
self.detailView(at: i)
|
self.detailView(at: i)
|
||||||
} else if !self.isActivated {
|
} else if !self.isActivated || self.selection == -1 {
|
||||||
HowToActivateView()
|
HowToActivateView()
|
||||||
} else {
|
} else {
|
||||||
Text("Select a server on the sidebar")
|
Text("Select a server on the sidebar")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue