Skip to content

Commit

Permalink
Add HUD autoHide and format
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 committed Nov 9, 2024
1 parent 924c5fb commit 4e825fa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/HUD/HUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ public extension View {
}
#else
public extension View {
func hud(_ text: String, isPresented: Binding<Bool>) -> some View {
func hud(_ text: String, autoHide: Bool = true, isPresented: Binding<Bool>) -> some View {
overlay(alignment: .top) {
HUD(text, isPresented: isPresented)
HUD(text, autoHide: autoHide, isPresented: isPresented)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Controls/Surface/Surface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public struct SurfaceButtonStyle: ButtonStyle {
public func makeBody(configuration: Self.Configuration) -> some View {
configuration.label
#if os(macOS)
.scaleEffect(configuration.isPressed ? 0.98 : 1)
.scaleEffect(configuration.isPressed ? 0.99 : 1)
#else
.scaleEffect(configuration.isPressed ? 0.96 : 1)
#endif
Expand Down
38 changes: 19 additions & 19 deletions Sources/OversizeUI/Core/Typography.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,40 @@ public struct Typography: ViewModifier {
#if os(macOS)
private var lineHeight: CGFloat {
switch fontStyle {
case .largeTitle: return 32
case .title: return 28
case .title2: return 24
case .title3: return 20
case .headline: return 16
case .subheadline: return 20
case .body, .callout, .footnote, .caption, .caption2: return 16
default: return 16
case .largeTitle: 32
case .title: 28
case .title2: 24
case .title3: 20
case .headline: 16
case .subheadline: 20
case .body, .callout, .footnote, .caption, .caption2: 16
default: 16
}
}
#else
private var lineHeight: CGFloat {
switch fontStyle {
case .largeTitle: return 44
case .title: return 36
case .title2: return 28
case .title3, .headline: return 24
case .subheadline, .body: return 20
case .callout, .footnote, .caption, .caption2: return 16
default: return 16
case .largeTitle: 44
case .title: 36
case .title2: 28
case .title3, .headline: 24
case .subheadline, .body: 20
case .callout, .footnote, .caption, .caption2: 16
default: 16
}
}
#endif

private var fontDesign: Font.Design {
switch fontStyle {
case .largeTitle, .title, .title2, .title3, .headline, .subheadline:
return theme.fontTitle.system
theme.fontTitle.system
case .body:
return theme.fontParagraph.system
theme.fontParagraph.system
case .caption, .caption2, .footnote, .callout:
return theme.fontOverline.system
theme.fontOverline.system
default:
return .default
.default
}
}

Expand Down

0 comments on commit 4e825fa

Please sign in to comment.