Add round style class #74
This commit is contained in:
parent
6b76a4c8f4
commit
c976c29cd0
@ -108,6 +108,13 @@ extension AnyView {
|
||||
style("circular", active: active)
|
||||
}
|
||||
|
||||
/// Make a button or similar widget use round appearance.
|
||||
/// - Parameter active: Whether the style is currently applied.
|
||||
/// - Returns: A view.
|
||||
public func round(_ active: Bool = true) -> AnyView {
|
||||
style("round", active: active)
|
||||
}
|
||||
|
||||
/// Make a button or similar widget appear as a pill.
|
||||
/// - Parameter active: Whether the style is currently applied.
|
||||
/// - Returns: A view.
|
||||
@ -367,4 +374,20 @@ extension AnyView {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the view has a width higher or equal to its natural width.
|
||||
/// - Parameters:
|
||||
/// - matches: Whether the content view matches the breakpoint.
|
||||
/// - padding: Increase the natural width by a certain padding.
|
||||
public func naturalWidth(matches: Binding<Bool>, padding: Int = 0) -> AnyView {
|
||||
BreakpointBin(condition: .naturalWidth(padding: padding), matches: matches) { self }
|
||||
}
|
||||
|
||||
/// Whether the view has a height higher or equal to its natural height.
|
||||
/// - Parameters:
|
||||
/// - matches: Whether the content view matches the breakpoint.
|
||||
/// - padding: Increase the natural height by a certain padding.
|
||||
public func naturalHeight(matches: Binding<Bool>, padding: Int = 0) -> AnyView {
|
||||
BreakpointBin(condition: .naturalHeight(padding: padding), matches: matches) { self }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -382,22 +382,6 @@ extension AnyView {
|
||||
BreakpointBin(condition: .minHeight(minHeight), matches: matches) { self }
|
||||
}
|
||||
|
||||
/// Whether the view has a width higher or equal to its natural width.
|
||||
/// - Parameters:
|
||||
/// - matches: Whether the content view matches the breakpoint.
|
||||
/// - padding: Increase the natural width by a certain padding.
|
||||
public func naturalWidth(matches: Binding<Bool>, padding: Int = 0) -> AnyView {
|
||||
BreakpointBin(condition: .naturalWidth(padding: padding), matches: matches) { self }
|
||||
}
|
||||
|
||||
/// Whether the view has a height higher or equal to its natural height.
|
||||
/// - Parameters:
|
||||
/// - matches: Whether the content view matches the breakpoint.
|
||||
/// - padding: Increase the natural height by a certain padding.
|
||||
public func naturalHeight(matches: Binding<Bool>, padding: Int = 0) -> AnyView {
|
||||
BreakpointBin(condition: .naturalHeight(padding: padding), matches: matches) { self }
|
||||
}
|
||||
|
||||
/// Build the UI from scratch once the identifier changes.
|
||||
/// - Parameter id: The identifier.
|
||||
public func id(_ id: CustomStringConvertible) -> AnyView {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user