405 lines
23 KiB
Swift
405 lines
23 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.AspectFrame
|
|
/// Preserves the aspect ratio of its child.
|
|
///
|
|
/// The frame can respect the aspect ratio of the child widget,
|
|
/// or use its own aspect ratio.
|
|
///
|
|
/// # CSS nodes
|
|
///
|
|
/// `GtkAspectFrame` uses a CSS node with name `aspectframe`.
|
|
///
|
|
/// # Accessibility
|
|
///
|
|
/// Until GTK 4.10, `GtkAspectFrame` used the [enum`Gtk`.AccessibleRole.group] role.
|
|
///
|
|
/// Starting from GTK 4.12, `GtkAspectFrame` uses the [enum`Gtk`.AccessibleRole.generic] role.
|
|
///
|
|
/// A Portico view that mounts a `Gtk.AspectFrame`.
|
|
@MainActor public struct AspectFrame: View {
|
|
private let make: (MountContext) -> Gtk.AspectFrame
|
|
private var configure: [(Gtk.AspectFrame, MountContext) -> Void] = []
|
|
|
|
public var body: Never { fatalError() }
|
|
|
|
// PorticoGen: generateInits(static) | source: Gtk.AspectFrame.init(xalign:yalign:ratio:obeyChild:)
|
|
/// Create a new `GtkAspectFrame`.
|
|
///
|
|
/// 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 xalign: The horizontal alignment of the child.
|
|
/// - Parameter yalign: The vertical alignment of the child.
|
|
/// - Parameter ratio: The aspect ratio to be used by the `GtkAspectFrame`.
|
|
/// - Parameter obeyChild: Whether the `GtkAspectFrame` should use the aspect ratio of its child.
|
|
/// - Parameter child: A `ViewBuilder` closure whose first view is mounted into the `child` slot.
|
|
public init(xalign: Float, yalign: Float, ratio: Float, obeyChild: Bool, @ViewBuilder child: @escaping () -> [AnyView] = { [] }) {
|
|
make = { _ in Gtk.AspectFrame(xalign: xalign, yalign: yalign, ratio: ratio, obeyChild: obeyChild) }
|
|
configure.append { w, ctx in
|
|
if let v = Portico.mountSlotChild(child, ctx, onUpdate: { v in w.setChild(child: v) }) { w.setChild(child: v) }
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateInits(binding) | source: Gtk.AspectFrame.init(xalign:yalign:ratio:obeyChild:), Gtk.AspectFrame.setXalign(xalign:), Gtk.AspectFrame.setYalign(yalign:), Gtk.AspectFrame.setRatio(ratio:), Gtk.AspectFrame.setObeyChild(obeyChild:)
|
|
/// Create a new `GtkAspectFrame`.
|
|
///
|
|
/// The initial value is the binding's current value; every later change is pushed into the widget through `Gtk.AspectFrame.setXalign(xalign:), Gtk.AspectFrame.setYalign(yalign:), Gtk.AspectFrame.setRatio(ratio:), Gtk.AspectFrame.setObeyChild(obeyChild:)` without rebuilding the view.
|
|
/// 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.
|
|
/// Optional `Binding` parameters bind through `Portico.bindProperty`, so they are two-way wherever the wrapper exposes a safe getter.
|
|
///
|
|
/// - Parameter xalign: The horizontal alignment of the child.
|
|
/// - Parameter yalign: The vertical alignment of the child.
|
|
/// - Parameter ratio: The aspect ratio to be used by the `GtkAspectFrame`.
|
|
/// - Parameter obeyChild: Whether the `GtkAspectFrame` should use the aspect ratio of its child.
|
|
/// - Parameter child: A `ViewBuilder` closure whose first view is mounted into the `child` slot.
|
|
public init(xalign: Portico.Binding<Float>, yalign: Portico.Binding<Float>, ratio: Portico.Binding<Float>, obeyChild: Portico.Binding<Bool>, @ViewBuilder child: @escaping () -> [AnyView] = { [] }) {
|
|
make = { _ in Gtk.AspectFrame(xalign: xalign.wrappedValue, yalign: yalign.wrappedValue, ratio: ratio.wrappedValue, obeyChild: obeyChild.wrappedValue) }
|
|
configure.append { w, ctx in
|
|
ctx.registry.add(xalign.subscribe { [w] v in w.setXalign(xalign: v) })
|
|
ctx.registry.add(yalign.subscribe { [w] v in w.setYalign(yalign: v) })
|
|
ctx.registry.add(ratio.subscribe { [w] v in w.setRatio(ratio: v) })
|
|
ctx.registry.add(obeyChild.subscribe { [w] v in w.setObeyChild(obeyChild: v) })
|
|
if let v = Portico.mountSlotChild(child, ctx, onUpdate: { v in w.setChild(child: v) }) { w.setChild(child: v) }
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateInits(closure) | source: Gtk.AspectFrame.init(xalign:yalign:ratio:obeyChild:), Gtk.AspectFrame.setXalign(xalign:), Gtk.AspectFrame.setYalign(yalign:), Gtk.AspectFrame.setRatio(ratio:), Gtk.AspectFrame.setObeyChild(obeyChild:)
|
|
/// Create a new `GtkAspectFrame`.
|
|
///
|
|
/// Each closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AspectFrame.setXalign(xalign:), Gtk.AspectFrame.setYalign(yalign:), Gtk.AspectFrame.setRatio(ratio:), Gtk.AspectFrame.setObeyChild(obeyChild:)`.
|
|
/// 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 xalign: The horizontal alignment of the child.
|
|
/// - Parameter yalign: The vertical alignment of the child.
|
|
/// - Parameter ratio: The aspect ratio to be used by the `GtkAspectFrame`.
|
|
/// - Parameter obeyChild: Whether the `GtkAspectFrame` should use the aspect ratio of its child.
|
|
/// - Parameter child: A `ViewBuilder` closure whose first view is mounted into the `child` slot.
|
|
public init(xalign: @escaping () -> Float, yalign: @escaping () -> Float, ratio: @escaping () -> Float, obeyChild: @escaping () -> Bool, @ViewBuilder child: @escaping () -> [AnyView] = { [] }) {
|
|
make = { _ in Gtk.AspectFrame(xalign: xalign(), yalign: yalign(), ratio: ratio(), obeyChild: obeyChild()) }
|
|
configure.append { w, ctx in
|
|
let t0 = DependencyTracker { [w] in w.setXalign(xalign: xalign()) }
|
|
t0.run()
|
|
ctx.registry.add(t0)
|
|
let t1 = DependencyTracker { [w] in w.setYalign(yalign: yalign()) }
|
|
t1.run()
|
|
ctx.registry.add(t1)
|
|
let t2 = DependencyTracker { [w] in w.setRatio(ratio: ratio()) }
|
|
t2.run()
|
|
ctx.registry.add(t2)
|
|
let t3 = DependencyTracker { [w] in w.setObeyChild(obeyChild: obeyChild()) }
|
|
t3.run()
|
|
ctx.registry.add(t3)
|
|
if let v = Portico.mountSlotChild(child, ctx, onUpdate: { v in w.setChild(child: v) }) { w.setChild(child: v) }
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
extension AspectFrame: WidgetView {
|
|
public typealias Target = Gtk.AspectFrame
|
|
|
|
@_spi(Portico) public func appending(
|
|
_ step: @escaping (Gtk.AspectFrame, MountContext) -> Void
|
|
) -> Self {
|
|
var c = self
|
|
c.configure.append(step)
|
|
return c
|
|
}
|
|
}
|
|
|
|
@_spi(Portico) extension AspectFrame: 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.AspectFrame
|
|
/// Modifiers for `Gtk.AspectFrame`, available on every Portico view whose
|
|
/// backing widget is `Gtk.AspectFrame` or one of its subclasses.
|
|
extension WidgetView where Target: Gtk.AspectFrame {
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AspectFrame.setChild(child:)
|
|
/// Sets the child widget of `self`.
|
|
///
|
|
/// 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.AspectFrame.setChild(child:)
|
|
/// Sets the child widget of `self`.
|
|
///
|
|
/// 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.AspectFrame.setChild(child:), GObject.Object.connectNotify(detail:_:), Gtk.AspectFrame.getChild()
|
|
/// Sets the child widget of `self`.
|
|
///
|
|
/// 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.AspectFrame.setChild(child:), GObject.Object.connectNotify(detail:_:), Gtk.AspectFrame.getChild()
|
|
/// Sets the child widget of `self`.
|
|
///
|
|
/// 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.AspectFrame.setChild(child:)
|
|
/// Sets the child widget of `self`.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AspectFrame.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.AspectFrame.setObeyChild(obeyChild:)
|
|
/// Sets whether the aspect ratio of the child's size
|
|
/// request should override the set aspect ratio of
|
|
/// the `GtkAspectFrame`.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter obeyChild: Whether the `GtkAspectFrame` should use the aspect ratio of its child.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func obeyChild(_ obeyChild: Bool) -> Self {
|
|
appending { w, _ in
|
|
w.setObeyChild(obeyChild: obeyChild)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AspectFrame.setObeyChild(obeyChild:), GObject.Object.connectNotify(detail:_:), Gtk.AspectFrame.getObeyChild()
|
|
/// Sets whether the aspect ratio of the child's size
|
|
/// request should override the set aspect ratio of
|
|
/// the `GtkAspectFrame`.
|
|
///
|
|
/// 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 obeyChild(_ obeyChild: Portico.Binding<Bool>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, obeyChild, registry: ctx.registry, notifyDetail: "obey-child",
|
|
read: { [w] in w.getObeyChild() },
|
|
write: { [w] v in w.setObeyChild(obeyChild: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AspectFrame.setObeyChild(obeyChild:)
|
|
/// Sets whether the aspect ratio of the child's size
|
|
/// request should override the set aspect ratio of
|
|
/// the `GtkAspectFrame`.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AspectFrame.setObeyChild(obeyChild:)`.
|
|
///
|
|
/// - Parameter obeyChild: Whether the `GtkAspectFrame` should use the aspect ratio of its child.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func obeyChild(_ obeyChild: @escaping () -> Bool) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setObeyChild(obeyChild: obeyChild()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AspectFrame.setRatio(ratio:)
|
|
/// Sets the desired aspect ratio of the child.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter ratio: The aspect ratio to be used by the `GtkAspectFrame`.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func ratio(_ ratio: Float) -> Self {
|
|
appending { w, _ in
|
|
w.setRatio(ratio: ratio)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AspectFrame.setRatio(ratio:), GObject.Object.connectNotify(detail:_:), Gtk.AspectFrame.getRatio()
|
|
/// Sets the desired aspect ratio of the child.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `Float` 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 ratio(_ ratio: Portico.Binding<Float>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, ratio, registry: ctx.registry, notifyDetail: "ratio",
|
|
read: { [w] in w.getRatio() },
|
|
write: { [w] v in w.setRatio(ratio: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AspectFrame.setRatio(ratio:)
|
|
/// Sets the desired aspect ratio of the child.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AspectFrame.setRatio(ratio:)`.
|
|
///
|
|
/// - Parameter ratio: The aspect ratio to be used by the `GtkAspectFrame`.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func ratio(_ ratio: @escaping () -> Float) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setRatio(ratio: ratio()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AspectFrame.setXalign(xalign:)
|
|
/// Sets the horizontal alignment of the child within the allocation
|
|
/// of the `GtkAspectFrame`.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter xalign: The horizontal alignment of the child.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func xalign(_ xalign: Float) -> Self {
|
|
appending { w, _ in
|
|
w.setXalign(xalign: xalign)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AspectFrame.setXalign(xalign:), GObject.Object.connectNotify(detail:_:), Gtk.AspectFrame.getXalign()
|
|
/// Sets the horizontal alignment of the child within the allocation
|
|
/// of the `GtkAspectFrame`.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `Float` 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 xalign(_ xalign: Portico.Binding<Float>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, xalign, registry: ctx.registry, notifyDetail: "xalign",
|
|
read: { [w] in w.getXalign() },
|
|
write: { [w] v in w.setXalign(xalign: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AspectFrame.setXalign(xalign:)
|
|
/// Sets the horizontal alignment of the child within the allocation
|
|
/// of the `GtkAspectFrame`.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AspectFrame.setXalign(xalign:)`.
|
|
///
|
|
/// - Parameter xalign: The horizontal alignment of the child.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func xalign(_ xalign: @escaping () -> Float) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setXalign(xalign: xalign()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AspectFrame.setYalign(yalign:)
|
|
/// Sets the vertical alignment of the child within the allocation
|
|
/// of the `GtkAspectFrame`.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter yalign: The vertical alignment of the child.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func yalign(_ yalign: Float) -> Self {
|
|
appending { w, _ in
|
|
w.setYalign(yalign: yalign)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AspectFrame.setYalign(yalign:), GObject.Object.connectNotify(detail:_:), Gtk.AspectFrame.getYalign()
|
|
/// Sets the vertical alignment of the child within the allocation
|
|
/// of the `GtkAspectFrame`.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `Float` 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 yalign(_ yalign: Portico.Binding<Float>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, yalign, registry: ctx.registry, notifyDetail: "yalign",
|
|
read: { [w] in w.getYalign() },
|
|
write: { [w] v in w.setYalign(yalign: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AspectFrame.setYalign(yalign:)
|
|
/// Sets the vertical alignment of the child within the allocation
|
|
/// of the `GtkAspectFrame`.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AspectFrame.setYalign(yalign:)`.
|
|
///
|
|
/// - Parameter yalign: The vertical alignment of the child.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func yalign(_ yalign: @escaping () -> Float) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setYalign(yalign: yalign()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
}
|