-
-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
137 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
import SwiftUI | ||
|
||
enum NavigationTag: String { | ||
case main | ||
case frontmostApplication | ||
case variables | ||
case devices | ||
case systemExtensions | ||
case unknownEvents | ||
case settings | ||
} | ||
|
||
struct ContentMainView: View { | ||
@State private var selection: NavigationTag = .main | ||
|
||
var body: some View { | ||
VStack { | ||
HStack { | ||
VStack(alignment: .leading, spacing: 0) { | ||
Button( | ||
action: { | ||
selection = .main | ||
}, | ||
label: { | ||
SidebarLabelView(text: "Main", systemImage: "magnifyingglass") | ||
} | ||
) | ||
.sidebarButtonStyle(selected: selection == .main) | ||
|
||
Button( | ||
action: { | ||
selection = .frontmostApplication | ||
}, | ||
label: { | ||
SidebarLabelView(text: "Frontmost Application", systemImage: "triangle.circle") | ||
} | ||
) | ||
.sidebarButtonStyle(selected: selection == .frontmostApplication) | ||
|
||
Button( | ||
action: { | ||
selection = .variables | ||
}, | ||
label: { | ||
SidebarLabelView(text: "Variables", systemImage: "cube") | ||
} | ||
) | ||
.sidebarButtonStyle(selected: selection == .variables) | ||
|
||
Button( | ||
action: { | ||
selection = .devices | ||
}, | ||
label: { | ||
SidebarLabelView(text: "Devices", systemImage: "keyboard") | ||
} | ||
) | ||
.sidebarButtonStyle(selected: selection == .devices) | ||
|
||
Button( | ||
action: { | ||
selection = .systemExtensions | ||
}, | ||
label: { | ||
SidebarLabelView(text: "System Extensions", systemImage: "puzzlepiece") | ||
} | ||
) | ||
.sidebarButtonStyle(selected: selection == .systemExtensions) | ||
|
||
Button( | ||
action: { | ||
selection = .unknownEvents | ||
}, | ||
label: { | ||
SidebarLabelView(text: "Unknown Events", systemImage: "questionmark.square.dashed") | ||
} | ||
) | ||
.sidebarButtonStyle(selected: selection == .unknownEvents) | ||
|
||
Button( | ||
action: { | ||
selection = .settings | ||
}, | ||
label: { | ||
SidebarLabelView(text: "Settings", systemImage: "gearshape") | ||
} | ||
) | ||
.sidebarButtonStyle(selected: selection == .settings) | ||
|
||
Spacer() | ||
} | ||
.frame(width: 250) | ||
|
||
Divider() | ||
|
||
switch selection { | ||
case .main: | ||
MainView() | ||
case .frontmostApplication: | ||
FrontmostApplicationView() | ||
case .variables: | ||
VariablesView() | ||
case .devices: | ||
DevicesView() | ||
case .systemExtensions: | ||
SystemExtensionsView() | ||
case .unknownEvents: | ||
UnknownEventsView() | ||
case .settings: | ||
SettingsView() | ||
} | ||
} | ||
} | ||
.frame( | ||
minWidth: 1100, | ||
maxWidth: .infinity, | ||
minHeight: 650, | ||
maxHeight: .infinity) | ||
} | ||
} | ||
|
||
struct ContentMainView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ContentMainView() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.