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

24 lines
No EOL
896 B
Swift

import Gtk
extension WidgetView where Target: Gtk.Separator {
/// Applies the `.spacer` style class.
///
/// Makes the separator invisible so it acts as whitespace; useful in toolbars to separate groups of widgets.
///
/// - Parameter enabled: Whether the style class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func spacer(_ enabled: Bool = true) -> Self {
styleClass("spacer", enabled)
}
/// Applies the `.spacer` style class.
///
/// Makes the separator invisible so it acts as whitespace; useful in toolbars to separate groups of widgets.
///
/// - Parameter enabled: A binding that controls whether the class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func spacer(_ enabled: Binding<Bool>) -> Self {
styleClass("spacer", enabled)
}
}