portico/Sources/Portico/Generated/Flap.swift

1019 lines
55 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: Adw.Flap
/// An adaptive container acting like a box or an overlay.
///
/// <picture>
/// <source srcset="flap-wide-dark.png" media="(prefers-color-scheme: dark)">
/// <img src="flap-wide.png" alt="flap-wide">
/// </picture>
/// <picture>
/// <source srcset="flap-narrow-dark.png" media="(prefers-color-scheme: dark)">
/// <img src="flap-narrow.png" alt="flap-narrow">
/// </picture>
///
/// The `AdwFlap` widget can display its children like a [class`Gtk`.Box] does or
/// like a [class`Gtk`.Overlay] does, according to the
/// [property`Flap`:fold-policy] value.
///
/// `AdwFlap` has at most three children: [property`Flap`:content],
/// [property`Flap`:flap] and [property`Flap`:separator]. Content is the primary
/// child, flap is displayed next to it when unfolded, or overlays it when
/// folded. Flap can be shown or hidden by changing the
/// [property`Flap`:reveal-flap] value, as well as via swipe gestures if
/// [property`Flap`:swipe-to-open] and/or [property`Flap`:swipe-to-close] are set
/// to `TRUE`.
///
/// Optionally, a separator can be provided, which would be displayed between
/// the content and the flap when there's no shadow to separate them, depending
/// on the transition type.
///
/// [property`Flap`:flap] is transparent by default; add the
/// [`.background`](style-classes.html`background`) style class to it if this is
/// unwanted.
///
/// If [property`Flap`:modal] is set to `TRUE`, content becomes completely
/// inaccessible when the flap is revealed while folded.
///
/// The position of the flap and separator children relative to the content is
/// determined by orientation, as well as the [property`Flap`:flap-position]
/// value.
///
/// Folding the flap will automatically hide the flap widget, and unfolding it
/// will automatically reveal it. If this behavior is not desired, the
/// [property`Flap`:locked] property can be used to override it.
///
/// Common use cases include sidebars, header bars that need to be able to
/// overlap the window content (for example, in fullscreen mode) and bottom
/// sheets.
///
/// ## AdwFlap as GtkBuildable
///
/// The `AdwFlap` implementation of the [iface`Gtk`.Buildable] interface supports
/// setting the flap child by specifying flap as the type attribute of a
/// `<child>` element, and separator by specifying separator. Specifying
/// content child type or omitting it results in setting the content child.
///
/// ## CSS nodes
///
/// `AdwFlap` has a single CSS node with name `flap`. The node will get the style
/// classes `.folded` when it is folded, and `.unfolded` when it's not.
///
/// A Portico view that mounts a `Adw.Flap`.
@MainActor public struct Flap: View {
private let make: (MountContext) -> Adw.Flap
private var configure: [(Adw.Flap, MountContext) -> Void] = []
public var body: Never { fatalError() }
// PorticoGen: generateInits(static) | source: Adw.Flap.init()
/// Creates a new `AdwFlap`.
///
/// 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 flapPosition: The flap position.
/// - Parameter foldDuration: The fold transition animation duration, in milliseconds.
/// - Parameter foldPolicy: The fold policy for the flap.
/// - Parameter foldThresholdPolicy: Determines when the flap will fold.
/// - Parameter locked: Whether the flap is locked.
/// - Parameter modal: Whether the flap is modal.
/// - Parameter revealFlap: Whether the flap widget is revealed.
/// - Parameter revealParams: The reveal animation spring parameters.
/// - Parameter swipeToClose: Whether the flap can be closed with a swipe gesture.
/// - Parameter swipeToOpen: Whether the flap can be opened with a swipe gesture.
/// - Parameter transitionType: the type of animation used for reveal and fold transitions.
/// - Parameter content: A `ViewBuilder` closure whose first view is mounted into the `content` slot.
/// - Parameter flap: A `ViewBuilder` closure whose first view is mounted into the `flap` slot.
/// - Parameter separator: A `ViewBuilder` closure whose first view is mounted into the `separator` slot.
public init(flapPosition: Adw.PackType? = nil, foldDuration: UInt32? = nil, foldPolicy: Adw.FlapFoldPolicy? = nil, foldThresholdPolicy: Adw.FoldThresholdPolicy? = nil, locked: Bool? = nil, modal: Bool? = nil, revealFlap: Bool? = nil, revealParams: Adw.SpringParams? = nil, swipeToClose: Bool? = nil, swipeToOpen: Bool? = nil, transitionType: Adw.FlapTransitionType? = nil, @ViewBuilder content: @escaping () -> [AnyView] = { [] }, @ViewBuilder flap: @escaping () -> [AnyView] = { [] }, @ViewBuilder separator: @escaping () -> [AnyView] = { [] }) {
make = { _ in Adw.Flap() }
configure.append { w, ctx in
if let flapPosition { w.setFlapPosition(position: flapPosition) }
if let foldDuration { w.setFoldDuration(duration: foldDuration) }
if let foldPolicy { w.setFoldPolicy(policy: foldPolicy) }
if let foldThresholdPolicy { w.setFoldThresholdPolicy(policy: foldThresholdPolicy) }
if let locked { w.setLocked(locked: locked) }
if let modal { w.setModal(modal: modal) }
if let revealFlap { w.setRevealFlap(revealFlap: revealFlap) }
if let revealParams { w.setRevealParams(params: revealParams) }
if let swipeToClose { w.setSwipeToClose(swipeToClose: swipeToClose) }
if let swipeToOpen { w.setSwipeToOpen(swipeToOpen: swipeToOpen) }
if let transitionType { w.setTransitionType(transitionType: transitionType) }
if let v = Portico.mountSlotChild(content, ctx, onUpdate: { v in w.setContent(content: v) }) { w.setContent(content: v) }
if let v = Portico.mountSlotChild(flap, ctx, onUpdate: { v in w.setFlap(flap: v) }) { w.setFlap(flap: v) }
if let v = Portico.mountSlotChild(separator, ctx, onUpdate: { v in w.setSeparator(separator: v) }) { w.setSeparator(separator: v) }
}
}
}
extension Flap: WidgetView {
public typealias Target = Adw.Flap
@_spi(Portico) public func appending(
_ step: @escaping (Adw.Flap, MountContext) -> Void
) -> Self {
var c = self
c.configure.append(step)
return c
}
}
@_spi(Portico) extension Flap: 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: Adw.Flap
/// Modifiers for `Adw.Flap`, available on every Portico view whose
/// backing widget is `Adw.Flap` or one of its subclasses.
extension WidgetView where Target: Adw.Flap {
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setContent(content:)
/// Sets the content widget for `self`.
///
/// It's always displayed when unfolded, and partially visible when folded.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter content: The content widget.
/// - Returns: A copy of this view with the modifier applied.
public func content(_ content: Adw.Widget?) -> Self {
appending { w, _ in
w.setContent(content: content)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(viewBuilder) | source: Adw.Flap.setContent(content:)
/// Sets the content widget for `self`.
///
/// It's always displayed when unfolded, and partially visible when folded.
///
/// 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 content: The content widget.
/// - Returns: A copy of this view with the modifier applied.
public func content(@ViewBuilder _ content: () -> [AnyView]) -> Self {
let contentViews = content()
return appending { w, ctx in
guard let v = contentViews.first else { return }
w.setContent(content: v.makeWidget(ctx))
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setContent(content:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getContent()
/// Sets the content widget for `self`.
///
/// It's always displayed when unfolded, and partially visible when folded.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Adw.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 content<W: Gtk.Widget>(_ content: Portico.Binding<W?>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, content, registry: ctx.registry, notifyDetail: "content",
read: { [w] in w.getContent() as? W },
write: { [w] v in w.setContent(content: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(lifted,twoWay) | source: Adw.Flap.setContent(content:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getContent()
/// Sets the content widget for `self`.
///
/// It's always displayed when unfolded, and partially visible when folded.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// `Binding` is invariant, so a `Binding<Adw.Widget>` is not accepted by the nullable overload; this one takes it and promotes each value. Pass a `Binding<Adw.Widget?>` to be able to clear the property.
/// When `Adw.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 content<W: Gtk.Widget>(_ content: Portico.Binding<W>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, content, registry: ctx.registry, notifyDetail: "content",
read: { [w] in w.getContent() as? W },
write: { [w] v in w.setContent(content: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setContent(content:)
/// Sets the content widget for `self`.
///
/// It's always displayed when unfolded, and partially visible when folded.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setContent(content:)`.
///
/// - Parameter content: The content widget.
/// - Returns: A copy of this view with the modifier applied.
public func content(_ content: @escaping () -> Adw.Widget?) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setContent(content: content()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setFlap(flap:)
/// Sets the flap widget for `self`.
///
/// It's only visible when [property`Flap`:reveal-progress] is greater than 0.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter flap: The flap widget.
/// - Returns: A copy of this view with the modifier applied.
public func flap(_ flap: Adw.Widget?) -> Self {
appending { w, _ in
w.setFlap(flap: flap)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(viewBuilder) | source: Adw.Flap.setFlap(flap:)
/// Sets the flap widget for `self`.
///
/// It's only visible when [property`Flap`:reveal-progress] is greater than 0.
///
/// 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 flap: The flap widget.
/// - Returns: A copy of this view with the modifier applied.
public func flap(@ViewBuilder _ flap: () -> [AnyView]) -> Self {
let flapViews = flap()
return appending { w, ctx in
guard let v = flapViews.first else { return }
w.setFlap(flap: v.makeWidget(ctx))
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setFlap(flap:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getFlap()
/// Sets the flap widget for `self`.
///
/// It's only visible when [property`Flap`:reveal-progress] is greater than 0.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Adw.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 flap<W: Gtk.Widget>(_ flap: Portico.Binding<W?>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, flap, registry: ctx.registry, notifyDetail: "flap",
read: { [w] in w.getFlap() as? W },
write: { [w] v in w.setFlap(flap: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(lifted,twoWay) | source: Adw.Flap.setFlap(flap:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getFlap()
/// Sets the flap widget for `self`.
///
/// It's only visible when [property`Flap`:reveal-progress] is greater than 0.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// `Binding` is invariant, so a `Binding<Adw.Widget>` is not accepted by the nullable overload; this one takes it and promotes each value. Pass a `Binding<Adw.Widget?>` to be able to clear the property.
/// When `Adw.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 flap<W: Gtk.Widget>(_ flap: Portico.Binding<W>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, flap, registry: ctx.registry, notifyDetail: "flap",
read: { [w] in w.getFlap() as? W },
write: { [w] v in w.setFlap(flap: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setFlap(flap:)
/// Sets the flap widget for `self`.
///
/// It's only visible when [property`Flap`:reveal-progress] is greater than 0.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setFlap(flap:)`.
///
/// - Parameter flap: The flap widget.
/// - Returns: A copy of this view with the modifier applied.
public func flap(_ flap: @escaping () -> Adw.Widget?) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setFlap(flap: flap()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setFlapPosition(position:)
/// Sets the flap position for `self`.
///
/// If it's set to [enum`Gtk`.PackType.start], the flap is displayed before the
/// content, if [enum`Gtk`.PackType.end], it's displayed after the content.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter flapPosition: The flap position.
/// - Returns: A copy of this view with the modifier applied.
public func flapPosition(_ flapPosition: Adw.PackType) -> Self {
appending { w, _ in
w.setFlapPosition(position: flapPosition)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setFlapPosition(position:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getFlapPosition()
/// Sets the flap position for `self`.
///
/// If it's set to [enum`Gtk`.PackType.start], the flap is displayed before the
/// content, if [enum`Gtk`.PackType.end], it's displayed after the content.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Adw.PackType` 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 flapPosition(_ flapPosition: Portico.Binding<Adw.PackType>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, flapPosition, registry: ctx.registry, notifyDetail: "flap-position",
read: { [w] in w.getFlapPosition() },
write: { [w] v in w.setFlapPosition(position: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setFlapPosition(position:)
/// Sets the flap position for `self`.
///
/// If it's set to [enum`Gtk`.PackType.start], the flap is displayed before the
/// content, if [enum`Gtk`.PackType.end], it's displayed after the content.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setFlapPosition(position:)`.
///
/// - Parameter flapPosition: The flap position.
/// - Returns: A copy of this view with the modifier applied.
public func flapPosition(_ flapPosition: @escaping () -> Adw.PackType) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setFlapPosition(position: flapPosition()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setFoldDuration(duration:)
/// Sets the fold transition animation duration for `self`, in milliseconds.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter foldDuration: The fold transition animation duration, in milliseconds.
/// - Returns: A copy of this view with the modifier applied.
public func foldDuration(_ foldDuration: UInt32) -> Self {
appending { w, _ in
w.setFoldDuration(duration: foldDuration)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setFoldDuration(duration:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getFoldDuration()
/// Sets the fold transition animation duration for `self`, in milliseconds.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `UInt32` 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 foldDuration(_ foldDuration: Portico.Binding<UInt32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, foldDuration, registry: ctx.registry, notifyDetail: "fold-duration",
read: { [w] in w.getFoldDuration() },
write: { [w] v in w.setFoldDuration(duration: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setFoldDuration(duration:)
/// Sets the fold transition animation duration for `self`, in milliseconds.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setFoldDuration(duration:)`.
///
/// - Parameter foldDuration: The fold transition animation duration, in milliseconds.
/// - Returns: A copy of this view with the modifier applied.
public func foldDuration(_ foldDuration: @escaping () -> UInt32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setFoldDuration(duration: foldDuration()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setFoldPolicy(policy:)
/// Sets the fold policy for `self`.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter foldPolicy: The fold policy for the flap.
/// - Returns: A copy of this view with the modifier applied.
public func foldPolicy(_ foldPolicy: Adw.FlapFoldPolicy) -> Self {
appending { w, _ in
w.setFoldPolicy(policy: foldPolicy)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setFoldPolicy(policy:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getFoldPolicy()
/// Sets the fold policy for `self`.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Adw.FlapFoldPolicy` 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 foldPolicy(_ foldPolicy: Portico.Binding<Adw.FlapFoldPolicy>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, foldPolicy, registry: ctx.registry, notifyDetail: "fold-policy",
read: { [w] in w.getFoldPolicy() },
write: { [w] v in w.setFoldPolicy(policy: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setFoldPolicy(policy:)
/// Sets the fold policy for `self`.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setFoldPolicy(policy:)`.
///
/// - Parameter foldPolicy: The fold policy for the flap.
/// - Returns: A copy of this view with the modifier applied.
public func foldPolicy(_ foldPolicy: @escaping () -> Adw.FlapFoldPolicy) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setFoldPolicy(policy: foldPolicy()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setFoldThresholdPolicy(policy:)
/// Sets the fold threshold policy for `self`.
///
/// If set to [enum`Adw`.FoldThresholdPolicy.minimum], flap will only fold when
/// the children cannot fit anymore. With [enum`Adw`.FoldThresholdPolicy.natural],
/// it will fold as soon as children don't get their natural size.
///
/// This can be useful if you have a long ellipsizing label and want to let it
/// ellipsize instead of immediately folding.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter foldThresholdPolicy: Determines when the flap will fold.
/// - Returns: A copy of this view with the modifier applied.
public func foldThresholdPolicy(_ foldThresholdPolicy: Adw.FoldThresholdPolicy) -> Self {
appending { w, _ in
w.setFoldThresholdPolicy(policy: foldThresholdPolicy)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setFoldThresholdPolicy(policy:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getFoldThresholdPolicy()
/// Sets the fold threshold policy for `self`.
///
/// If set to [enum`Adw`.FoldThresholdPolicy.minimum], flap will only fold when
/// the children cannot fit anymore. With [enum`Adw`.FoldThresholdPolicy.natural],
/// it will fold as soon as children don't get their natural size.
///
/// This can be useful if you have a long ellipsizing label and want to let it
/// ellipsize instead of immediately folding.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Adw.FoldThresholdPolicy` 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 foldThresholdPolicy(_ foldThresholdPolicy: Portico.Binding<Adw.FoldThresholdPolicy>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, foldThresholdPolicy, registry: ctx.registry, notifyDetail: "fold-threshold-policy",
read: { [w] in w.getFoldThresholdPolicy() },
write: { [w] v in w.setFoldThresholdPolicy(policy: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setFoldThresholdPolicy(policy:)
/// Sets the fold threshold policy for `self`.
///
/// If set to [enum`Adw`.FoldThresholdPolicy.minimum], flap will only fold when
/// the children cannot fit anymore. With [enum`Adw`.FoldThresholdPolicy.natural],
/// it will fold as soon as children don't get their natural size.
///
/// This can be useful if you have a long ellipsizing label and want to let it
/// ellipsize instead of immediately folding.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setFoldThresholdPolicy(policy:)`.
///
/// - Parameter foldThresholdPolicy: Determines when the flap will fold.
/// - Returns: A copy of this view with the modifier applied.
public func foldThresholdPolicy(_ foldThresholdPolicy: @escaping () -> Adw.FoldThresholdPolicy) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setFoldThresholdPolicy(policy: foldThresholdPolicy()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setLocked(locked:)
/// Sets whether `self` is locked.
///
/// If `FALSE`, folding when the flap is revealed automatically closes it, and
/// unfolding it when the flap is not revealed opens it. If `TRUE`,
/// [property`Flap`:reveal-flap] value never changes on its own.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter locked: Whether the flap is locked.
/// - Returns: A copy of this view with the modifier applied.
public func locked(_ locked: Bool) -> Self {
appending { w, _ in
w.setLocked(locked: locked)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setLocked(locked:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getLocked()
/// Sets whether `self` is locked.
///
/// If `FALSE`, folding when the flap is revealed automatically closes it, and
/// unfolding it when the flap is not revealed opens it. If `TRUE`,
/// [property`Flap`:reveal-flap] value never changes on its own.
///
/// 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 locked(_ locked: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, locked, registry: ctx.registry, notifyDetail: "locked",
read: { [w] in w.getLocked() },
write: { [w] v in w.setLocked(locked: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setLocked(locked:)
/// Sets whether `self` is locked.
///
/// If `FALSE`, folding when the flap is revealed automatically closes it, and
/// unfolding it when the flap is not revealed opens it. If `TRUE`,
/// [property`Flap`:reveal-flap] value never changes on its own.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setLocked(locked:)`.
///
/// - Parameter locked: Whether the flap is locked.
/// - Returns: A copy of this view with the modifier applied.
public func locked(_ locked: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setLocked(locked: locked()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setModal(modal:)
/// Sets whether `self` is modal.
///
/// If `TRUE`, clicking the content widget while flap is revealed, as well as
/// pressing the <kbd>Esc</kbd> key, will close the flap. If `FALSE`, clicks are
/// passed through to the content widget.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter modal: Whether the flap is modal.
/// - Returns: A copy of this view with the modifier applied.
public func modal(_ modal: Bool) -> Self {
appending { w, _ in
w.setModal(modal: modal)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setModal(modal:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getModal()
/// Sets whether `self` is modal.
///
/// If `TRUE`, clicking the content widget while flap is revealed, as well as
/// pressing the <kbd>Esc</kbd> key, will close the flap. If `FALSE`, clicks are
/// passed through to the content widget.
///
/// 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 modal(_ modal: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, modal, registry: ctx.registry, notifyDetail: "modal",
read: { [w] in w.getModal() },
write: { [w] v in w.setModal(modal: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setModal(modal:)
/// Sets whether `self` is modal.
///
/// If `TRUE`, clicking the content widget while flap is revealed, as well as
/// pressing the <kbd>Esc</kbd> key, will close the flap. If `FALSE`, clicks are
/// passed through to the content widget.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setModal(modal:)`.
///
/// - Parameter modal: Whether the flap is modal.
/// - Returns: A copy of this view with the modifier applied.
public func modal(_ modal: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setModal(modal: modal()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setRevealFlap(revealFlap:)
/// Sets whether the flap widget is revealed for `self`.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter revealFlap: Whether the flap widget is revealed.
/// - Returns: A copy of this view with the modifier applied.
public func revealFlap(_ revealFlap: Bool) -> Self {
appending { w, _ in
w.setRevealFlap(revealFlap: revealFlap)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setRevealFlap(revealFlap:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getRevealFlap()
/// Sets whether the flap widget is revealed for `self`.
///
/// 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 revealFlap(_ revealFlap: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, revealFlap, registry: ctx.registry, notifyDetail: "reveal-flap",
read: { [w] in w.getRevealFlap() },
write: { [w] v in w.setRevealFlap(revealFlap: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setRevealFlap(revealFlap:)
/// Sets whether the flap widget is revealed for `self`.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setRevealFlap(revealFlap:)`.
///
/// - Parameter revealFlap: Whether the flap widget is revealed.
/// - Returns: A copy of this view with the modifier applied.
public func revealFlap(_ revealFlap: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setRevealFlap(revealFlap: revealFlap()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setRevealParams(params:)
/// Sets the reveal animation spring parameters for `self`.
///
/// The default value is equivalent to:
///
/// ```c
/// adw_spring_params_new (1, 0.5, 500)
/// ```
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter revealParams: The reveal animation spring parameters.
/// - Returns: A copy of this view with the modifier applied.
public func revealParams(_ revealParams: Adw.SpringParams) -> Self {
appending { w, _ in
w.setRevealParams(params: revealParams)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setRevealParams(params:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getRevealParams()
/// Sets the reveal animation spring parameters for `self`.
///
/// The default value is equivalent to:
///
/// ```c
/// adw_spring_params_new (1, 0.5, 500)
/// ```
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Adw.SpringParams` 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 revealParams(_ revealParams: Portico.Binding<Adw.SpringParams>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, revealParams, registry: ctx.registry, notifyDetail: "reveal-params",
read: { [w] in w.getRevealParams() },
write: { [w] v in w.setRevealParams(params: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setRevealParams(params:)
/// Sets the reveal animation spring parameters for `self`.
///
/// The default value is equivalent to:
///
/// ```c
/// adw_spring_params_new (1, 0.5, 500)
/// ```
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setRevealParams(params:)`.
///
/// - Parameter revealParams: The reveal animation spring parameters.
/// - Returns: A copy of this view with the modifier applied.
public func revealParams(_ revealParams: @escaping () -> Adw.SpringParams) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setRevealParams(params: revealParams()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setSeparator(separator:)
/// Sets the separator widget for `self`.
///
/// It's displayed between content and flap when there's no shadow to display.
/// When exactly it's visible depends on the [property`Flap`:transition-type]
/// value.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter separator: The separator widget.
/// - Returns: A copy of this view with the modifier applied.
public func separator(_ separator: Adw.Widget?) -> Self {
appending { w, _ in
w.setSeparator(separator: separator)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(viewBuilder) | source: Adw.Flap.setSeparator(separator:)
/// Sets the separator widget for `self`.
///
/// It's displayed between content and flap when there's no shadow to display.
/// When exactly it's visible depends on the [property`Flap`:transition-type]
/// value.
///
/// 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 separator: The separator widget.
/// - Returns: A copy of this view with the modifier applied.
public func separator(@ViewBuilder _ separator: () -> [AnyView]) -> Self {
let separatorViews = separator()
return appending { w, ctx in
guard let v = separatorViews.first else { return }
w.setSeparator(separator: v.makeWidget(ctx))
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setSeparator(separator:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getSeparator()
/// Sets the separator widget for `self`.
///
/// It's displayed between content and flap when there's no shadow to display.
/// When exactly it's visible depends on the [property`Flap`:transition-type]
/// value.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Adw.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 separator<W: Gtk.Widget>(_ separator: Portico.Binding<W?>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, separator, registry: ctx.registry, notifyDetail: "separator",
read: { [w] in w.getSeparator() as? W },
write: { [w] v in w.setSeparator(separator: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(lifted,twoWay) | source: Adw.Flap.setSeparator(separator:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getSeparator()
/// Sets the separator widget for `self`.
///
/// It's displayed between content and flap when there's no shadow to display.
/// When exactly it's visible depends on the [property`Flap`:transition-type]
/// value.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// `Binding` is invariant, so a `Binding<Adw.Widget>` is not accepted by the nullable overload; this one takes it and promotes each value. Pass a `Binding<Adw.Widget?>` to be able to clear the property.
/// When `Adw.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 separator<W: Gtk.Widget>(_ separator: Portico.Binding<W>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, separator, registry: ctx.registry, notifyDetail: "separator",
read: { [w] in w.getSeparator() as? W },
write: { [w] v in w.setSeparator(separator: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setSeparator(separator:)
/// Sets the separator widget for `self`.
///
/// It's displayed between content and flap when there's no shadow to display.
/// When exactly it's visible depends on the [property`Flap`:transition-type]
/// value.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setSeparator(separator:)`.
///
/// - Parameter separator: The separator widget.
/// - Returns: A copy of this view with the modifier applied.
public func separator(_ separator: @escaping () -> Adw.Widget?) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setSeparator(separator: separator()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setSwipeToClose(swipeToClose:)
/// Sets whether `self` can be closed with a swipe gesture.
///
/// The area that can be swiped depends on the [property`Flap`:transition-type]
/// value.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter swipeToClose: Whether the flap can be closed with a swipe gesture.
/// - Returns: A copy of this view with the modifier applied.
public func swipeToClose(_ swipeToClose: Bool) -> Self {
appending { w, _ in
w.setSwipeToClose(swipeToClose: swipeToClose)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setSwipeToClose(swipeToClose:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getSwipeToClose()
/// Sets whether `self` can be closed with a swipe gesture.
///
/// The area that can be swiped depends on the [property`Flap`:transition-type]
/// value.
///
/// 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 swipeToClose(_ swipeToClose: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, swipeToClose, registry: ctx.registry, notifyDetail: "swipe-to-close",
read: { [w] in w.getSwipeToClose() },
write: { [w] v in w.setSwipeToClose(swipeToClose: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setSwipeToClose(swipeToClose:)
/// Sets whether `self` can be closed with a swipe gesture.
///
/// The area that can be swiped depends on the [property`Flap`:transition-type]
/// value.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setSwipeToClose(swipeToClose:)`.
///
/// - Parameter swipeToClose: Whether the flap can be closed with a swipe gesture.
/// - Returns: A copy of this view with the modifier applied.
public func swipeToClose(_ swipeToClose: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setSwipeToClose(swipeToClose: swipeToClose()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setSwipeToOpen(swipeToOpen:)
/// Sets whether `self` can be opened with a swipe gesture.
///
/// The area that can be swiped depends on the [property`Flap`:transition-type]
/// value.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter swipeToOpen: Whether the flap can be opened with a swipe gesture.
/// - Returns: A copy of this view with the modifier applied.
public func swipeToOpen(_ swipeToOpen: Bool) -> Self {
appending { w, _ in
w.setSwipeToOpen(swipeToOpen: swipeToOpen)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setSwipeToOpen(swipeToOpen:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getSwipeToOpen()
/// Sets whether `self` can be opened with a swipe gesture.
///
/// The area that can be swiped depends on the [property`Flap`:transition-type]
/// value.
///
/// 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 swipeToOpen(_ swipeToOpen: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, swipeToOpen, registry: ctx.registry, notifyDetail: "swipe-to-open",
read: { [w] in w.getSwipeToOpen() },
write: { [w] v in w.setSwipeToOpen(swipeToOpen: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setSwipeToOpen(swipeToOpen:)
/// Sets whether `self` can be opened with a swipe gesture.
///
/// The area that can be swiped depends on the [property`Flap`:transition-type]
/// value.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setSwipeToOpen(swipeToOpen:)`.
///
/// - Parameter swipeToOpen: Whether the flap can be opened with a swipe gesture.
/// - Returns: A copy of this view with the modifier applied.
public func swipeToOpen(_ swipeToOpen: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setSwipeToOpen(swipeToOpen: swipeToOpen()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Adw.Flap.setTransitionType(transitionType:)
/// Sets the type of animation used for reveal and fold transitions in `self`.
///
/// [property`Flap`:flap] is transparent by default, which means the content will
/// be seen through it with [enum`Adw`.FlapTransitionType.over] transitions; add
/// the [`.background`](style-classes.html`background`) style class to it if this
/// is unwanted.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter transitionType: the type of animation used for reveal and fold transitions.
/// - Returns: A copy of this view with the modifier applied.
public func transitionType(_ transitionType: Adw.FlapTransitionType) -> Self {
appending { w, _ in
w.setTransitionType(transitionType: transitionType)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Adw.Flap.setTransitionType(transitionType:), GObject.Object.connectNotify(detail:_:), Adw.Flap.getTransitionType()
/// Sets the type of animation used for reveal and fold transitions in `self`.
///
/// [property`Flap`:flap] is transparent by default, which means the content will
/// be seen through it with [enum`Adw`.FlapTransitionType.over] transitions; add
/// the [`.background`](style-classes.html`background`) style class to it if this
/// is unwanted.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Adw.FlapTransitionType` 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 transitionType(_ transitionType: Portico.Binding<Adw.FlapTransitionType>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, transitionType, registry: ctx.registry, notifyDetail: "transition-type",
read: { [w] in w.getTransitionType() },
write: { [w] v in w.setTransitionType(transitionType: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Adw.Flap.setTransitionType(transitionType:)
/// Sets the type of animation used for reveal and fold transitions in `self`.
///
/// [property`Flap`:flap] is transparent by default, which means the content will
/// be seen through it with [enum`Adw`.FlapTransitionType.over] transitions; add
/// the [`.background`](style-classes.html`background`) style class to it if this
/// is unwanted.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Adw.Flap.setTransitionType(transitionType:)`.
///
/// - Parameter transitionType: the type of animation used for reveal and fold transitions.
/// - Returns: A copy of this view with the modifier applied.
public func transitionType(_ transitionType: @escaping () -> Adw.FlapTransitionType) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setTransitionType(transitionType: transitionType()) }
tracker.run()
ctx.registry.add(tracker)
}
}
}