diff --git a/Sources/Adwaita/View/AnyView++.swift b/Sources/Adwaita/View/AnyView++.swift index 8be99b7..a432b54 100644 --- a/Sources/Adwaita/View/AnyView++.swift +++ b/Sources/Adwaita/View/AnyView++.swift @@ -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, 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, padding: Int = 0) -> AnyView { + BreakpointBin(condition: .naturalHeight(padding: padding), matches: matches) { self } + } + } diff --git a/Sources/Adwaita/View/AnyView+.swift b/Sources/Adwaita/View/AnyView+.swift index 851b547..2cca766 100644 --- a/Sources/Adwaita/View/AnyView+.swift +++ b/Sources/Adwaita/View/AnyView+.swift @@ -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, 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, 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 {