Skip to content

Commit

Permalink
Merge pull request #67 from mock-foundation/macos
Browse files Browse the repository at this point in the history
Improved macOS design
  • Loading branch information
SvenTiigi authored Oct 9, 2024
2 parents 6157c77 + f3c5a85 commit 23f6a2a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
19 changes: 5 additions & 14 deletions Sources/View/WhatsNewView+PrimaryButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,13 @@ extension WhatsNewView.PrimaryButtonStyle: ButtonStyle {
func makeBody(
configuration: Configuration
) -> some View {
Group {
#if os(iOS)
HStack {
Spacer()
configuration
.label
.font(.headline.weight(.semibold))
.padding(.vertical)
Spacer()
}
#else
HStack {
Spacer()
configuration
.label
.padding(.horizontal, 60)
.padding(.vertical, 8)
#endif
.font(.headline.weight(.semibold))
.padding(.vertical)
Spacer()
}
.foregroundColor(self.primaryAction.foregroundColor)
.background(self.primaryAction.backgroundColor)
Expand Down
10 changes: 9 additions & 1 deletion Sources/View/WhatsNewView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ extension WhatsNewView: View {
}
.edgesIgnoringSafeArea(.bottom)
}
#if os(macOS)
.frame(minWidth: 400, maxWidth: 600)
#endif
.sheet(
item: self.$secondaryActionPresentedView,
content: { $0.view }
Expand Down Expand Up @@ -226,15 +229,20 @@ private extension WhatsNewView {
Text(
whatsNewText: self.whatsNew.primaryAction.title
)
#if os(macOS)
.frame(minWidth: 150)
#endif
}
#if os(iOS)
.buttonStyle(
PrimaryButtonStyle(
primaryAction: self.whatsNew.primaryAction,
layout: self.layout
)
)
#if os(macOS)
#elseif os(macOS)
.keyboardShortcut(.defaultAction)
.controlSize(.large)
#endif
}
}
Expand Down

0 comments on commit 23f6a2a

Please sign in to comment.