-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #461 from XcodesOrg/matt/redesign
Redesign the main window to better suit more data
- Loading branch information
Showing
22 changed files
with
519 additions
and
222 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
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
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,46 @@ | ||
// | ||
// NavigationSplitViewWrapper.swift | ||
// Xcodes | ||
// | ||
// Created by Matt Kiazyk on 2023-12-12. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct NavigationSplitViewWrapper<Sidebar, Detail>: View where Sidebar: View, Detail: View { | ||
private var sidebar: Sidebar | ||
private var detail: Detail | ||
|
||
init( | ||
@ViewBuilder sidebar: () -> Sidebar, | ||
@ViewBuilder detail: () -> Detail | ||
) { | ||
self.sidebar = sidebar() | ||
self.detail = detail() | ||
} | ||
|
||
var body: some View { | ||
if #available(iOS 16, macOS 13, tvOS 16, watchOS 9, visionOS 1, *) { | ||
// Use the latest API available | ||
NavigationSplitView { | ||
|
||
if #available(macOS 14, *) { | ||
sidebar | ||
.toolbar(removing: .sidebarToggle) | ||
} else { | ||
sidebar | ||
} | ||
} detail: { | ||
detail | ||
} | ||
} else { | ||
// Alternative code for earlier versions of OS. | ||
NavigationView { | ||
// The first column is the sidebar. | ||
sidebar | ||
detail | ||
} | ||
.navigationViewStyle(.columns) | ||
} | ||
} | ||
} |
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,35 @@ | ||
// | ||
// CornerRadiusModifier.swift | ||
// Xcodes | ||
// | ||
// Created by Matt Kiazyk on 2023-12-19. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
struct CornerRadiusModifier: ViewModifier { | ||
func body(content: Content) -> some View { | ||
content | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
.padding() | ||
.background(.background) | ||
.clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous)) | ||
} | ||
} | ||
|
||
extension View { | ||
func xcodesBackground() -> some View { | ||
self.modifier( | ||
CornerRadiusModifier() | ||
) | ||
} | ||
} | ||
|
||
struct Previews_CornerRadius_Previews: PreviewProvider { | ||
static var previews: some View { | ||
HStack { | ||
Text("XCODES RULES!") | ||
}.xcodesBackground() | ||
} | ||
} |
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
Oops, something went wrong.