portico/Sources/Portico/Extensions/TabBar+Extras.swift

24 lines
No EOL
891 B
Swift

import Adw
extension WidgetView where Target: Adw.TabBar {
/// Applies the `.inline` style class.
///
/// Swaps the header-bar-attached look for a neutral background so the widget can be used in other contexts.
///
/// - Parameter enabled: Whether the style class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func inline(_ enabled: Bool = true) -> Self {
styleClass("inline", enabled)
}
/// Applies the `.inline` style class.
///
/// Swaps the header-bar-attached look for a neutral background so the widget can be used in other contexts.
///
/// - Parameter enabled: A binding that controls whether the class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func inline(_ enabled: Binding<Bool>) -> Self {
styleClass("inline", enabled)
}
}