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

84 lines
No EOL
3.5 KiB
Swift

import Gtk
extension WidgetView where Target: Gtk.ScrolledWindow {
/// Applies the `.undershoot-top` style class.
///
/// Shadow undershoot indicator on the top edge. Since libadwaita 1.4. Most applications should use `Adw.ToolbarView`, which manages undershoots automatically.
///
/// - Parameter enabled: Whether the style class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func undershootTop(_ enabled: Bool = true) -> Self {
styleClass("undershoot-top", enabled)
}
/// Applies the `.undershoot-top` style class.
///
/// Shadow undershoot indicator on the top edge. Since libadwaita 1.4. Most applications should use `Adw.ToolbarView`, which manages undershoots automatically.
///
/// - Parameter enabled: A binding that controls whether the class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func undershootTop(_ enabled: Binding<Bool>) -> Self {
styleClass("undershoot-top", enabled)
}
/// Applies the `.undershoot-bottom` style class.
///
/// Shadow undershoot indicator on the bottom edge. Since libadwaita 1.4.
///
/// - Parameter enabled: Whether the style class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func undershootBottom(_ enabled: Bool = true) -> Self {
styleClass("undershoot-bottom", enabled)
}
/// Applies the `.undershoot-bottom` style class.
///
/// Shadow undershoot indicator on the bottom edge. Since libadwaita 1.4.
///
/// - Parameter enabled: A binding that controls whether the class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func undershootBottom(_ enabled: Binding<Bool>) -> Self {
styleClass("undershoot-bottom", enabled)
}
/// Applies the `.undershoot-start` style class.
///
/// Shadow undershoot indicator on the start edge (follows text direction). Since libadwaita 1.4.
///
/// - Parameter enabled: Whether the style class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func undershootStart(_ enabled: Bool = true) -> Self {
styleClass("undershoot-start", enabled)
}
/// Applies the `.undershoot-start` style class.
///
/// Shadow undershoot indicator on the start edge (follows text direction). Since libadwaita 1.4.
///
/// - Parameter enabled: A binding that controls whether the class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func undershootStart(_ enabled: Binding<Bool>) -> Self {
styleClass("undershoot-start", enabled)
}
/// Applies the `.undershoot-end` style class.
///
/// Shadow undershoot indicator on the end edge (follows text direction). Since libadwaita 1.4.
///
/// - Parameter enabled: Whether the style class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func undershootEnd(_ enabled: Bool = true) -> Self {
styleClass("undershoot-end", enabled)
}
/// Applies the `.undershoot-end` style class.
///
/// Shadow undershoot indicator on the end edge (follows text direction). Since libadwaita 1.4.
///
/// - Parameter enabled: A binding that controls whether the class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func undershootEnd(_ enabled: Binding<Bool>) -> Self {
styleClass("undershoot-end", enabled)
}
}