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

24 lines
No EOL
877 B
Swift

import Gtk
extension WidgetView where Target: Gtk.TextView {
/// Applies the `.inline` style class.
///
/// Lets the view sit inside a card while following its styles. Cannot be used with `GtkSourceView`.
///
/// - 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.
///
/// Lets the view sit inside a card while following its styles. Cannot be used with `GtkSourceView`.
///
/// - 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)
}
}