902 lines
52 KiB
Swift
902 lines
52 KiB
Swift
// Generated by PorticoGen. DO NOT EDIT. See Sources/PorticoGen to make changes.
|
||
|
||
import Adw
|
||
import Gtk
|
||
import Gio
|
||
import Gdk
|
||
|
||
// PorticoGen: generateStruct | source: Gtk.ScrolledWindow
|
||
/// Makes its child scrollable.
|
||
///
|
||
/// <picture>
|
||
/// <source srcset="scrolledwindow-dark.png" media="(prefers-color-scheme: dark)">
|
||
/// <img alt="An example GtkScrolledWindow" src="scrolledwindow.png">
|
||
/// </picture>
|
||
///
|
||
/// It does so using either internally added scrollbars or externally
|
||
/// associated adjustments, and optionally draws a frame around the child.
|
||
///
|
||
/// Widgets with native scrolling support, i.e. those whose classes implement
|
||
/// the [iface`Gtk`.Scrollable] interface, are added directly. For other types
|
||
/// of widget, the class [class`Gtk`.Viewport] acts as an adaptor, giving
|
||
/// scrollability to other widgets. [method`Gtk`.ScrolledWindow.set_child]
|
||
/// intelligently accounts for whether or not the added child is a `GtkScrollable`.
|
||
/// If it isn’t, then it wraps the child in a `GtkViewport`. Therefore, you can
|
||
/// just add any child widget and not worry about the details.
|
||
///
|
||
/// If [method`Gtk`.ScrolledWindow.set_child] has added a `GtkViewport` for you,
|
||
/// it will be automatically removed when you unset the child.
|
||
/// Unless [property`Gtk`.ScrolledWindow:hscrollbar-policy] and
|
||
/// [property`Gtk`.ScrolledWindow:vscrollbar-policy] are `GTK_POLICY_NEVER` or
|
||
/// `GTK_POLICY_EXTERNAL`, `GtkScrolledWindow` adds internal `GtkScrollbar` widgets
|
||
/// around its child. The scroll position of the child, and if applicable the
|
||
/// scrollbars, is controlled by the [property`Gtk`.ScrolledWindow:hadjustment]
|
||
/// and [property`Gtk`.ScrolledWindow:vadjustment] that are associated with the
|
||
/// `GtkScrolledWindow`. See the docs on [class`Gtk`.Scrollbar] for the details,
|
||
/// but note that the “step_increment” and “page_increment” fields are only
|
||
/// effective if the policy causes scrollbars to be present.
|
||
///
|
||
/// If a `GtkScrolledWindow` doesn’t behave quite as you would like, or
|
||
/// doesn’t have exactly the right layout, it’s very possible to set up
|
||
/// your own scrolling with `GtkScrollbar` and for example a `GtkGrid`.
|
||
///
|
||
/// # Touch support
|
||
///
|
||
/// `GtkScrolledWindow` has built-in support for touch devices. When a
|
||
/// touchscreen is used, swiping will move the scrolled window, and will
|
||
/// expose 'kinetic' behavior. This can be turned off with the
|
||
/// [property`Gtk`.ScrolledWindow:kinetic-scrolling] property if it is undesired.
|
||
///
|
||
/// `GtkScrolledWindow` also displays visual 'overshoot' indication when
|
||
/// the content is pulled beyond the end, and this situation can be
|
||
/// captured with the [signal`Gtk`.ScrolledWindow::edge-overshot] signal.
|
||
///
|
||
/// If no mouse device is present, the scrollbars will overlaid as
|
||
/// narrow, auto-hiding indicators over the content. If traditional
|
||
/// scrollbars are desired although no mouse is present, this behaviour
|
||
/// can be turned off with the [property`Gtk`.ScrolledWindow:overlay-scrolling]
|
||
/// property.
|
||
///
|
||
/// # Shortcuts and Gestures
|
||
///
|
||
/// The following signals have default keybindings:
|
||
///
|
||
/// - [signal`Gtk`.ScrolledWindow::scroll-child]
|
||
///
|
||
/// # CSS nodes
|
||
///
|
||
/// `GtkScrolledWindow` has a main CSS node with name scrolledwindow.
|
||
/// It gets a .frame style class added when [property`Gtk`.ScrolledWindow:has-frame]
|
||
/// is `true`.
|
||
///
|
||
/// It uses subnodes with names overshoot and undershoot to draw the overflow
|
||
/// and underflow indications. These nodes get the .left, .right, .top or .bottom
|
||
/// style class added depending on where the indication is drawn.
|
||
///
|
||
/// `GtkScrolledWindow` also sets the positional style classes (.left, .right,
|
||
/// .top, .bottom) and style classes related to overlay scrolling
|
||
/// (.overlay-indicator, .dragging, .hovering) on its scrollbars.
|
||
///
|
||
/// If both scrollbars are visible, the area where they meet is drawn
|
||
/// with a subnode named junction.
|
||
///
|
||
/// # Accessibility
|
||
///
|
||
/// Until GTK 4.10, `GtkScrolledWindow` used the [enum`Gtk`.AccessibleRole.group] role.
|
||
///
|
||
/// Starting from GTK 4.12, `GtkScrolledWindow` uses the [enum`Gtk`.AccessibleRole.generic]
|
||
/// role.
|
||
///
|
||
/// A Portico view that mounts a `Gtk.ScrolledWindow`.
|
||
@MainActor public struct ScrolledWindow: View {
|
||
private let make: (MountContext) -> Gtk.ScrolledWindow
|
||
private var configure: [(Gtk.ScrolledWindow, MountContext) -> Void] = []
|
||
|
||
public var body: Never { fatalError() }
|
||
|
||
// PorticoGen: generateInits(static) | source: Gtk.ScrolledWindow.init()
|
||
/// Creates a new scrolled window.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for values that change.
|
||
/// Each closure is evaluated once; children are added in order and slot closures mount their first view.
|
||
/// An empty closure adds no children and leaves slots unset.
|
||
/// Optional value parameters are applied only when non-`nil`; a `nil` argument leaves the widget's own default in place and cannot clear a nullable property - use the matching modifier for that.
|
||
///
|
||
/// - Parameter hasFrame: Whether to draw a frame around the contents.
|
||
/// - Parameter kineticScrolling: Whether kinetic scrolling is enabled or not.
|
||
/// - Parameter maxContentHeight: The maximum content height of `scrolled_window`.
|
||
/// - Parameter maxContentWidth: The maximum content width of `scrolled_window`.
|
||
/// - Parameter minContentHeight: The minimum content height of `scrolled_window`.
|
||
/// - Parameter minContentWidth: The minimum content width of `scrolled_window`.
|
||
/// - Parameter overlayScrolling: Whether overlay scrolling is enabled or not.
|
||
/// - Parameter propagateNaturalHeight: Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
|
||
/// - Parameter propagateNaturalWidth: Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
|
||
/// - Parameter windowPlacement: Where the contents are located with respect to the scrollbars.
|
||
/// - Parameter child: A `ViewBuilder` closure whose first view is mounted into the `child` slot.
|
||
/// - Parameter onEdgeOvershot: Invoked when the widget emits the `edge-overshot` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onEdgeReached: Invoked when the widget emits the `edge-reached` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onMoveFocusOut: Invoked when the widget emits the `move-focus-out` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onScrollChild: Invoked when the widget emits the `scroll-child` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
public init(hasFrame: Bool? = nil, kineticScrolling: Bool? = nil, maxContentHeight: Int32? = nil, maxContentWidth: Int32? = nil, minContentHeight: Int32? = nil, minContentWidth: Int32? = nil, overlayScrolling: Bool? = nil, propagateNaturalHeight: Bool? = nil, propagateNaturalWidth: Bool? = nil, windowPlacement: Gtk.CornerType? = nil, @ViewBuilder child: @escaping () -> [AnyView] = { [] }, onEdgeOvershot: ((Gtk.PositionType) -> Void)? = nil, onEdgeReached: ((Gtk.PositionType) -> Void)? = nil, onMoveFocusOut: ((Gtk.DirectionType) -> Void)? = nil, onScrollChild: ((Gtk.ScrollType, Bool) -> Bool)? = nil) {
|
||
make = { _ in Gtk.ScrolledWindow() }
|
||
configure.append { w, ctx in
|
||
if let hasFrame { w.setHasFrame(hasFrame: hasFrame) }
|
||
if let kineticScrolling { w.setKineticScrolling(kineticScrolling: kineticScrolling) }
|
||
if let maxContentHeight { w.setMaxContentHeight(height: maxContentHeight) }
|
||
if let maxContentWidth { w.setMaxContentWidth(width: maxContentWidth) }
|
||
if let minContentHeight { w.setMinContentHeight(height: minContentHeight) }
|
||
if let minContentWidth { w.setMinContentWidth(width: minContentWidth) }
|
||
if let overlayScrolling { w.setOverlayScrolling(overlayScrolling: overlayScrolling) }
|
||
if let propagateNaturalHeight { w.setPropagateNaturalHeight(propagate: propagateNaturalHeight) }
|
||
if let propagateNaturalWidth { w.setPropagateNaturalWidth(propagate: propagateNaturalWidth) }
|
||
if let windowPlacement { w.setPlacement(windowPlacement: windowPlacement) }
|
||
if let v = Portico.mountSlotChild(child, ctx, onUpdate: { v in w.setChild(child: v) }) { w.setChild(child: v) }
|
||
if let onEdgeOvershot { ctx.registry.add(w.connectEdgeOvershot { _, a0 in onEdgeOvershot(a0) }) }
|
||
if let onEdgeReached { ctx.registry.add(w.connectEdgeReached { _, a0 in onEdgeReached(a0) }) }
|
||
if let onMoveFocusOut { ctx.registry.add(w.connectMoveFocusOut { _, a0 in onMoveFocusOut(a0) }) }
|
||
if let onScrollChild { ctx.registry.add(w.connectScrollChild { _, a0, a1 in onScrollChild(a0, a1) }) }
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
extension ScrolledWindow: WidgetView {
|
||
public typealias Target = Gtk.ScrolledWindow
|
||
|
||
@_spi(Portico) public func appending(
|
||
_ step: @escaping (Gtk.ScrolledWindow, MountContext) -> Void
|
||
) -> Self {
|
||
var c = self
|
||
c.configure.append(step)
|
||
return c
|
||
}
|
||
}
|
||
|
||
@_spi(Portico) extension ScrolledWindow: Mountable {
|
||
@_spi(Portico) public func mount(_ ctx: MountContext) -> Gtk.Widget {
|
||
let w = make(ctx)
|
||
for step in configure { step(w, ctx) }
|
||
return w
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension | source: Gtk.ScrolledWindow
|
||
/// Modifiers for `Gtk.ScrolledWindow`, available on every Portico view whose
|
||
/// backing widget is `Gtk.ScrolledWindow` or one of its subclasses.
|
||
extension WidgetView where Target: Gtk.ScrolledWindow {
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setChild(child:)
|
||
/// Sets the child widget of `scrolled_window`.
|
||
///
|
||
/// If `child` does not implement the [iface`Gtk`.Scrollable] interface,
|
||
/// the scrolled window will add `child` to a [class`Gtk`.Viewport] instance
|
||
/// and then add the viewport as its child widget.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter child: The child widget.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func child(_ child: Gtk.Widget?) -> Self {
|
||
appending { w, _ in
|
||
w.setChild(child: child)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(viewBuilder) | source: Gtk.ScrolledWindow.setChild(child:)
|
||
/// Sets the child widget of `scrolled_window`.
|
||
///
|
||
/// If `child` does not implement the [iface`Gtk`.Scrollable] interface,
|
||
/// the scrolled window will add `child` to a [class`Gtk`.Viewport] instance
|
||
/// and then add the viewport as its child widget.
|
||
///
|
||
/// The closure is evaluated once when the modifier is applied. Its first view is mounted into the slot.
|
||
/// Additional views are ignored; an empty closure leaves the slot unset.
|
||
///
|
||
/// - Parameter child: The child widget.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func child(@ViewBuilder _ child: () -> [AnyView]) -> Self {
|
||
let childViews = child()
|
||
return appending { w, ctx in
|
||
guard let v = childViews.first else { return }
|
||
w.setChild(child: v.makeWidget(ctx))
|
||
}
|
||
}
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setChild(child:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getChild()
|
||
/// Sets the child widget of `scrolled_window`.
|
||
///
|
||
/// If `child` does not implement the [iface`Gtk`.Scrollable] interface,
|
||
/// the scrolled window will add `child` to a [class`Gtk`.Viewport] instance
|
||
/// and then add the viewport as its child widget.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Gtk.Widget?` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func child<W: Gtk.Widget>(_ child: Portico.Binding<W?>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, child, registry: ctx.registry, notifyDetail: "child",
|
||
read: { [w] in w.getChild() as? W },
|
||
write: { [w] v in w.setChild(child: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(lifted,twoWay) | source: Gtk.ScrolledWindow.setChild(child:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getChild()
|
||
/// Sets the child widget of `scrolled_window`.
|
||
///
|
||
/// If `child` does not implement the [iface`Gtk`.Scrollable] interface,
|
||
/// the scrolled window will add `child` to a [class`Gtk`.Viewport] instance
|
||
/// and then add the viewport as its child widget.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// `Binding` is invariant, so a `Binding<Gtk.Widget>` is not accepted by the nullable overload; this one takes it and promotes each value. Pass a `Binding<Gtk.Widget?>` to be able to clear the property.
|
||
/// When `Gtk.Widget` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
/// A `nil` widget value is never written back into the binding.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func child<W: Gtk.Widget>(_ child: Portico.Binding<W>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, child, registry: ctx.registry, notifyDetail: "child",
|
||
read: { [w] in w.getChild() as? W },
|
||
write: { [w] v in w.setChild(child: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setChild(child:)
|
||
/// Sets the child widget of `scrolled_window`.
|
||
///
|
||
/// If `child` does not implement the [iface`Gtk`.Scrollable] interface,
|
||
/// the scrolled window will add `child` to a [class`Gtk`.Viewport] instance
|
||
/// and then add the viewport as its child widget.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setChild(child:)`.
|
||
///
|
||
/// - Parameter child: The child widget.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func child(_ child: @escaping () -> Gtk.Widget?) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setChild(child: child()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setHasFrame(hasFrame:)
|
||
/// Changes the frame drawn around the contents of `scrolled_window`.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter hasFrame: Whether to draw a frame around the contents.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hasFrame(_ hasFrame: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setHasFrame(hasFrame: hasFrame)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setHasFrame(hasFrame:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getHasFrame()
|
||
/// Changes the frame drawn around the contents of `scrolled_window`.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hasFrame(_ hasFrame: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, hasFrame, registry: ctx.registry, notifyDetail: "has-frame",
|
||
read: { [w] in w.getHasFrame() },
|
||
write: { [w] v in w.setHasFrame(hasFrame: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setHasFrame(hasFrame:)
|
||
/// Changes the frame drawn around the contents of `scrolled_window`.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setHasFrame(hasFrame:)`.
|
||
///
|
||
/// - Parameter hasFrame: Whether to draw a frame around the contents.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hasFrame(_ hasFrame: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setHasFrame(hasFrame: hasFrame()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setKineticScrolling(kineticScrolling:)
|
||
/// Turns kinetic scrolling on or off.
|
||
///
|
||
/// Kinetic scrolling only applies to devices with source
|
||
/// `GDK_SOURCE_TOUCHSCREEN`.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter kineticScrolling: Whether kinetic scrolling is enabled or not.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func kineticScrolling(_ kineticScrolling: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setKineticScrolling(kineticScrolling: kineticScrolling)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setKineticScrolling(kineticScrolling:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getKineticScrolling()
|
||
/// Turns kinetic scrolling on or off.
|
||
///
|
||
/// Kinetic scrolling only applies to devices with source
|
||
/// `GDK_SOURCE_TOUCHSCREEN`.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func kineticScrolling(_ kineticScrolling: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, kineticScrolling, registry: ctx.registry, notifyDetail: "kinetic-scrolling",
|
||
read: { [w] in w.getKineticScrolling() },
|
||
write: { [w] v in w.setKineticScrolling(kineticScrolling: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setKineticScrolling(kineticScrolling:)
|
||
/// Turns kinetic scrolling on or off.
|
||
///
|
||
/// Kinetic scrolling only applies to devices with source
|
||
/// `GDK_SOURCE_TOUCHSCREEN`.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setKineticScrolling(kineticScrolling:)`.
|
||
///
|
||
/// - Parameter kineticScrolling: Whether kinetic scrolling is enabled or not.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func kineticScrolling(_ kineticScrolling: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setKineticScrolling(kineticScrolling: kineticScrolling()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setMaxContentHeight(height:)
|
||
/// Sets the maximum height that `scrolled_window` should keep visible.
|
||
///
|
||
/// The `scrolled_window` will grow up to this height before it starts
|
||
/// scrolling the content.
|
||
///
|
||
/// It is a programming error to set the maximum content height to a value
|
||
/// smaller than [property`Gtk`.ScrolledWindow:min-content-height].
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter maxContentHeight: The maximum content height of `scrolled_window`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func maxContentHeight(_ maxContentHeight: Int32) -> Self {
|
||
appending { w, _ in
|
||
w.setMaxContentHeight(height: maxContentHeight)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setMaxContentHeight(height:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getMaxContentHeight()
|
||
/// Sets the maximum height that `scrolled_window` should keep visible.
|
||
///
|
||
/// The `scrolled_window` will grow up to this height before it starts
|
||
/// scrolling the content.
|
||
///
|
||
/// It is a programming error to set the maximum content height to a value
|
||
/// smaller than [property`Gtk`.ScrolledWindow:min-content-height].
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func maxContentHeight(_ maxContentHeight: Portico.Binding<Int32>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, maxContentHeight, registry: ctx.registry, notifyDetail: "max-content-height",
|
||
read: { [w] in w.getMaxContentHeight() },
|
||
write: { [w] v in w.setMaxContentHeight(height: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setMaxContentHeight(height:)
|
||
/// Sets the maximum height that `scrolled_window` should keep visible.
|
||
///
|
||
/// The `scrolled_window` will grow up to this height before it starts
|
||
/// scrolling the content.
|
||
///
|
||
/// It is a programming error to set the maximum content height to a value
|
||
/// smaller than [property`Gtk`.ScrolledWindow:min-content-height].
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setMaxContentHeight(height:)`.
|
||
///
|
||
/// - Parameter maxContentHeight: The maximum content height of `scrolled_window`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func maxContentHeight(_ maxContentHeight: @escaping () -> Int32) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setMaxContentHeight(height: maxContentHeight()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setMaxContentWidth(width:)
|
||
/// Sets the maximum width that `scrolled_window` should keep visible.
|
||
///
|
||
/// The `scrolled_window` will grow up to this width before it starts
|
||
/// scrolling the content.
|
||
///
|
||
/// It is a programming error to set the maximum content width to a
|
||
/// value smaller than [property`Gtk`.ScrolledWindow:min-content-width].
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter maxContentWidth: The maximum content width of `scrolled_window`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func maxContentWidth(_ maxContentWidth: Int32) -> Self {
|
||
appending { w, _ in
|
||
w.setMaxContentWidth(width: maxContentWidth)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setMaxContentWidth(width:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getMaxContentWidth()
|
||
/// Sets the maximum width that `scrolled_window` should keep visible.
|
||
///
|
||
/// The `scrolled_window` will grow up to this width before it starts
|
||
/// scrolling the content.
|
||
///
|
||
/// It is a programming error to set the maximum content width to a
|
||
/// value smaller than [property`Gtk`.ScrolledWindow:min-content-width].
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func maxContentWidth(_ maxContentWidth: Portico.Binding<Int32>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, maxContentWidth, registry: ctx.registry, notifyDetail: "max-content-width",
|
||
read: { [w] in w.getMaxContentWidth() },
|
||
write: { [w] v in w.setMaxContentWidth(width: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setMaxContentWidth(width:)
|
||
/// Sets the maximum width that `scrolled_window` should keep visible.
|
||
///
|
||
/// The `scrolled_window` will grow up to this width before it starts
|
||
/// scrolling the content.
|
||
///
|
||
/// It is a programming error to set the maximum content width to a
|
||
/// value smaller than [property`Gtk`.ScrolledWindow:min-content-width].
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setMaxContentWidth(width:)`.
|
||
///
|
||
/// - Parameter maxContentWidth: The maximum content width of `scrolled_window`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func maxContentWidth(_ maxContentWidth: @escaping () -> Int32) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setMaxContentWidth(width: maxContentWidth()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setMinContentHeight(height:)
|
||
/// Sets the minimum height that `scrolled_window` should keep visible.
|
||
///
|
||
/// Note that this can and (usually will) be smaller than the minimum
|
||
/// size of the content.
|
||
///
|
||
/// It is a programming error to set the minimum content height to a
|
||
/// value greater than [property`Gtk`.ScrolledWindow:max-content-height].
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter minContentHeight: The minimum content height of `scrolled_window`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func minContentHeight(_ minContentHeight: Int32) -> Self {
|
||
appending { w, _ in
|
||
w.setMinContentHeight(height: minContentHeight)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setMinContentHeight(height:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getMinContentHeight()
|
||
/// Sets the minimum height that `scrolled_window` should keep visible.
|
||
///
|
||
/// Note that this can and (usually will) be smaller than the minimum
|
||
/// size of the content.
|
||
///
|
||
/// It is a programming error to set the minimum content height to a
|
||
/// value greater than [property`Gtk`.ScrolledWindow:max-content-height].
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func minContentHeight(_ minContentHeight: Portico.Binding<Int32>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, minContentHeight, registry: ctx.registry, notifyDetail: "min-content-height",
|
||
read: { [w] in w.getMinContentHeight() },
|
||
write: { [w] v in w.setMinContentHeight(height: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setMinContentHeight(height:)
|
||
/// Sets the minimum height that `scrolled_window` should keep visible.
|
||
///
|
||
/// Note that this can and (usually will) be smaller than the minimum
|
||
/// size of the content.
|
||
///
|
||
/// It is a programming error to set the minimum content height to a
|
||
/// value greater than [property`Gtk`.ScrolledWindow:max-content-height].
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setMinContentHeight(height:)`.
|
||
///
|
||
/// - Parameter minContentHeight: The minimum content height of `scrolled_window`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func minContentHeight(_ minContentHeight: @escaping () -> Int32) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setMinContentHeight(height: minContentHeight()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setMinContentWidth(width:)
|
||
/// Sets the minimum width that `scrolled_window` should keep visible.
|
||
///
|
||
/// Note that this can and (usually will) be smaller than the minimum
|
||
/// size of the content.
|
||
///
|
||
/// It is a programming error to set the minimum content width to a
|
||
/// value greater than [property`Gtk`.ScrolledWindow:max-content-width].
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter minContentWidth: The minimum content width of `scrolled_window`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func minContentWidth(_ minContentWidth: Int32) -> Self {
|
||
appending { w, _ in
|
||
w.setMinContentWidth(width: minContentWidth)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setMinContentWidth(width:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getMinContentWidth()
|
||
/// Sets the minimum width that `scrolled_window` should keep visible.
|
||
///
|
||
/// Note that this can and (usually will) be smaller than the minimum
|
||
/// size of the content.
|
||
///
|
||
/// It is a programming error to set the minimum content width to a
|
||
/// value greater than [property`Gtk`.ScrolledWindow:max-content-width].
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func minContentWidth(_ minContentWidth: Portico.Binding<Int32>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, minContentWidth, registry: ctx.registry, notifyDetail: "min-content-width",
|
||
read: { [w] in w.getMinContentWidth() },
|
||
write: { [w] v in w.setMinContentWidth(width: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setMinContentWidth(width:)
|
||
/// Sets the minimum width that `scrolled_window` should keep visible.
|
||
///
|
||
/// Note that this can and (usually will) be smaller than the minimum
|
||
/// size of the content.
|
||
///
|
||
/// It is a programming error to set the minimum content width to a
|
||
/// value greater than [property`Gtk`.ScrolledWindow:max-content-width].
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setMinContentWidth(width:)`.
|
||
///
|
||
/// - Parameter minContentWidth: The minimum content width of `scrolled_window`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func minContentWidth(_ minContentWidth: @escaping () -> Int32) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setMinContentWidth(width: minContentWidth()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setOverlayScrolling(overlayScrolling:)
|
||
/// Enables or disables overlay scrolling for this scrolled window.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter overlayScrolling: Whether overlay scrolling is enabled or not.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func overlayScrolling(_ overlayScrolling: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setOverlayScrolling(overlayScrolling: overlayScrolling)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setOverlayScrolling(overlayScrolling:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getOverlayScrolling()
|
||
/// Enables or disables overlay scrolling for this scrolled window.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func overlayScrolling(_ overlayScrolling: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, overlayScrolling, registry: ctx.registry, notifyDetail: "overlay-scrolling",
|
||
read: { [w] in w.getOverlayScrolling() },
|
||
write: { [w] v in w.setOverlayScrolling(overlayScrolling: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setOverlayScrolling(overlayScrolling:)
|
||
/// Enables or disables overlay scrolling for this scrolled window.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setOverlayScrolling(overlayScrolling:)`.
|
||
///
|
||
/// - Parameter overlayScrolling: Whether overlay scrolling is enabled or not.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func overlayScrolling(_ overlayScrolling: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setOverlayScrolling(overlayScrolling: overlayScrolling()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setPropagateNaturalHeight(propagate:)
|
||
/// Sets whether the natural height of the child should be calculated
|
||
/// and propagated through the scrolled window’s requested natural height.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter propagateNaturalHeight: Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func propagateNaturalHeight(_ propagateNaturalHeight: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setPropagateNaturalHeight(propagate: propagateNaturalHeight)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setPropagateNaturalHeight(propagate:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getPropagateNaturalHeight()
|
||
/// Sets whether the natural height of the child should be calculated
|
||
/// and propagated through the scrolled window’s requested natural height.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func propagateNaturalHeight(_ propagateNaturalHeight: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, propagateNaturalHeight, registry: ctx.registry, notifyDetail: "propagate-natural-height",
|
||
read: { [w] in w.getPropagateNaturalHeight() },
|
||
write: { [w] v in w.setPropagateNaturalHeight(propagate: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setPropagateNaturalHeight(propagate:)
|
||
/// Sets whether the natural height of the child should be calculated
|
||
/// and propagated through the scrolled window’s requested natural height.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setPropagateNaturalHeight(propagate:)`.
|
||
///
|
||
/// - Parameter propagateNaturalHeight: Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func propagateNaturalHeight(_ propagateNaturalHeight: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setPropagateNaturalHeight(propagate: propagateNaturalHeight()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setPropagateNaturalWidth(propagate:)
|
||
/// Sets whether the natural width of the child should be calculated
|
||
/// and propagated through the scrolled window’s requested natural width.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter propagateNaturalWidth: Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func propagateNaturalWidth(_ propagateNaturalWidth: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setPropagateNaturalWidth(propagate: propagateNaturalWidth)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setPropagateNaturalWidth(propagate:), GObject.Object.connectNotify(detail:_:), Gtk.ScrolledWindow.getPropagateNaturalWidth()
|
||
/// Sets whether the natural width of the child should be calculated
|
||
/// and propagated through the scrolled window’s requested natural width.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func propagateNaturalWidth(_ propagateNaturalWidth: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, propagateNaturalWidth, registry: ctx.registry, notifyDetail: "propagate-natural-width",
|
||
read: { [w] in w.getPropagateNaturalWidth() },
|
||
write: { [w] v in w.setPropagateNaturalWidth(propagate: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setPropagateNaturalWidth(propagate:)
|
||
/// Sets whether the natural width of the child should be calculated
|
||
/// and propagated through the scrolled window’s requested natural width.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setPropagateNaturalWidth(propagate:)`.
|
||
///
|
||
/// - Parameter propagateNaturalWidth: Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func propagateNaturalWidth(_ propagateNaturalWidth: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setPropagateNaturalWidth(propagate: propagateNaturalWidth()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ScrolledWindow.setPlacement(windowPlacement:)
|
||
/// Sets the placement of the contents with respect to the scrollbars
|
||
/// for the scrolled window.
|
||
///
|
||
/// The default is `GTK_CORNER_TOP_LEFT`, meaning the child is
|
||
/// in the top left, with the scrollbars underneath and to the right.
|
||
/// Other values in [enum`Gtk`.CornerType] are `GTK_CORNER_TOP_RIGHT`,
|
||
/// `GTK_CORNER_BOTTOM_LEFT`, and `GTK_CORNER_BOTTOM_RIGHT`.
|
||
///
|
||
/// See also [method`Gtk`.ScrolledWindow.get_placement] and
|
||
/// [method`Gtk`.ScrolledWindow.unset_placement].
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter windowPlacement: Where the contents are located with respect to the scrollbars.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func windowPlacement(_ windowPlacement: Gtk.CornerType) -> Self {
|
||
appending { w, _ in
|
||
w.setPlacement(windowPlacement: windowPlacement)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ScrolledWindow.setPlacement(windowPlacement:), GObject.Object.connectNotify(detail:_:)
|
||
/// Sets the placement of the contents with respect to the scrollbars
|
||
/// for the scrolled window.
|
||
///
|
||
/// The default is `GTK_CORNER_TOP_LEFT`, meaning the child is
|
||
/// in the top left, with the scrollbars underneath and to the right.
|
||
/// Other values in [enum`Gtk`.CornerType] are `GTK_CORNER_TOP_RIGHT`,
|
||
/// `GTK_CORNER_BOTTOM_LEFT`, and `GTK_CORNER_BOTTOM_RIGHT`.
|
||
///
|
||
/// See also [method`Gtk`.ScrolledWindow.get_placement] and
|
||
/// [method`Gtk`.ScrolledWindow.unset_placement].
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Gtk.CornerType` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func windowPlacement(_ windowPlacement: Portico.Binding<Gtk.CornerType>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, windowPlacement, registry: ctx.registry, notifyDetail: "window-placement",
|
||
read: { [w] in w.windowPlacement },
|
||
write: { [w] v in w.setPlacement(windowPlacement: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ScrolledWindow.setPlacement(windowPlacement:)
|
||
/// Sets the placement of the contents with respect to the scrollbars
|
||
/// for the scrolled window.
|
||
///
|
||
/// The default is `GTK_CORNER_TOP_LEFT`, meaning the child is
|
||
/// in the top left, with the scrollbars underneath and to the right.
|
||
/// Other values in [enum`Gtk`.CornerType] are `GTK_CORNER_TOP_RIGHT`,
|
||
/// `GTK_CORNER_BOTTOM_LEFT`, and `GTK_CORNER_BOTTOM_RIGHT`.
|
||
///
|
||
/// See also [method`Gtk`.ScrolledWindow.get_placement] and
|
||
/// [method`Gtk`.ScrolledWindow.unset_placement].
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ScrolledWindow.setPlacement(windowPlacement:)`.
|
||
///
|
||
/// - Parameter windowPlacement: Where the contents are located with respect to the scrollbars.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func windowPlacement(_ windowPlacement: @escaping () -> Gtk.CornerType) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setPlacement(windowPlacement: windowPlacement()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.ScrolledWindow.connectEdgeOvershot(_:)
|
||
/// Emitted whenever user initiated scrolling makes the scrolled
|
||
/// window firmly surpass the limits defined by the adjustment
|
||
/// in that orientation.
|
||
///
|
||
/// A similar behavior without edge resistance is provided by the
|
||
/// [signal`Gtk`.ScrolledWindow::edge-reached] signal.
|
||
///
|
||
/// Note: The `pos` argument is LTR/RTL aware, so callers should be
|
||
/// aware too if intending to provide behavior on horizontal edges.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `edge-overshot` signal. The closure receives the signal's arguments in order.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onEdgeOvershot(_ handler: @escaping (Gtk.PositionType) -> Void) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectEdgeOvershot { _, a0 in handler(a0) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.ScrolledWindow.connectEdgeReached(_:)
|
||
/// Emitted whenever user-initiated scrolling makes the scrolled
|
||
/// window exactly reach the lower or upper limits defined by the
|
||
/// adjustment in that orientation.
|
||
///
|
||
/// A similar behavior with edge resistance is provided by the
|
||
/// [signal`Gtk`.ScrolledWindow::edge-overshot] signal.
|
||
///
|
||
/// Note: The `pos` argument is LTR/RTL aware, so callers should be
|
||
/// aware too if intending to provide behavior on horizontal edges.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `edge-reached` signal. The closure receives the signal's arguments in order.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onEdgeReached(_ handler: @escaping (Gtk.PositionType) -> Void) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectEdgeReached { _, a0 in handler(a0) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.ScrolledWindow.connectMoveFocusOut(_:)
|
||
/// Emitted when focus is moved away from the scrolled window by a
|
||
/// keybinding.
|
||
///
|
||
/// This is a [keybinding signal](class.SignalAction.html).
|
||
///
|
||
/// The default bindings for this signal are
|
||
/// <kbd>Ctrl</kbd>+<kbd>Tab</kbd> to move forward and
|
||
/// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Tab</kbd>` to move backward.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `move-focus-out` signal. The closure receives the signal's arguments in order.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onMoveFocusOut(_ handler: @escaping (Gtk.DirectionType) -> Void) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectMoveFocusOut { _, a0 in handler(a0) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.ScrolledWindow.connectScrollChild(_:)
|
||
/// Emitted when a keybinding that scrolls is pressed.
|
||
///
|
||
/// This is a [keybinding signal](class.SignalAction.html).
|
||
///
|
||
/// The horizontal or vertical adjustment is updated which triggers a
|
||
/// signal that the scrolled window’s child may listen to and scroll itself.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `scroll-child` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onScrollChild(_ handler: @escaping (Gtk.ScrollType, Bool) -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectScrollChild { _, a0, a1 in handler(a0, a1) })
|
||
}
|
||
}
|
||
|
||
}
|