portico/Sources/Portico/Generated/ProgressBar.swift

533 lines
28 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.ProgressBar
/// Displays the progress of a long-running operation.
///
/// `GtkProgressBar` provides a visual clue that processing is underway.
/// It can be used in two different modes: percentage mode and activity mode.
///
/// <picture>
/// <source srcset="progressbar-dark.png" media="(prefers-color-scheme: dark)">
/// <img alt="An example GtkProgressBar" src="progressbar.png">
/// </picture>
///
/// When an application can determine how much work needs to take place
/// (e.g. read a fixed number of bytes from a file) and can monitor its
/// progress, it can use the `GtkProgressBar` in percentage mode and the
/// user sees a growing bar indicating the percentage of the work that
/// has been completed. In this mode, the application is required to call
/// [method`Gtk`.ProgressBar.set_fraction] periodically to update the progress bar.
///
/// When an application has no accurate way of knowing the amount of work
/// to do, it can use the `GtkProgressBar` in activity mode, which shows
/// activity by a block moving back and forth within the progress area. In
/// this mode, the application is required to call [method`Gtk`.ProgressBar.pulse]
/// periodically to update the progress bar.
///
/// There is quite a bit of flexibility provided to control the appearance
/// of the `GtkProgressBar`. Functions are provided to control the orientation
/// of the bar, optional text can be displayed along with the bar, and the
/// step size used in activity mode can be set.
///
/// # CSS nodes
///
/// ```
/// progressbar[.osd]
/// [text]
/// trough[.empty][.full]
/// progress[.pulse]
/// ```
///
/// `GtkProgressBar` has a main CSS node with name progressbar and subnodes with
/// names text and trough, of which the latter has a subnode named progress. The
/// text subnode is only present if text is shown. The progress subnode has the
/// style class .pulse when in activity mode. It gets the style classes .left,
/// .right, .top or .bottom added when the progress 'touches' the corresponding
/// end of the GtkProgressBar. The .osd class on the progressbar node is for use
/// in overlays like the one Epiphany has for page loading progress.
///
/// # Accessibility
///
/// `GtkProgressBar` uses the [enum`Gtk`.AccessibleRole.progress_bar] role
/// and sets the [enum`Gtk`.AccessibleProperty.value_min], [enum`Gtk`.AccessibleProperty.value_max] and [enum`Gtk`.AccessibleProperty.value_now] properties to reflect
/// the progress.
///
/// A Portico view that mounts a `Gtk.ProgressBar`.
@MainActor public struct ProgressBar: View {
private let make: (MountContext) -> Gtk.ProgressBar
private var configure: [(Gtk.ProgressBar, MountContext) -> Void] = []
public var body: Never { fatalError() }
// PorticoGen: generateInits(static) | source: Gtk.ProgressBar.init()
/// Creates a new `GtkProgressBar`.
///
/// Applied once at mount; use the `Binding` or closure overload for values that change.
/// 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 ellipsize: The preferred place to ellipsize the string.
/// - Parameter fraction: The fraction of total work that has been completed.
/// - Parameter inverted: Invert the direction in which the progress bar grows.
/// - Parameter pulseStep: The fraction of total progress to move the bounding block when pulsed.
/// - Parameter showText: Sets whether the progress bar will show a text in addition to the bar itself.
/// - Parameter text: Text to be displayed in the progress bar.
public init(ellipsize: Gtk.EllipsizeMode? = nil, fraction: Double? = nil, inverted: Bool? = nil, pulseStep: Double? = nil, showText: Bool? = nil, text: String? = nil) {
make = { _ in Gtk.ProgressBar() }
configure.append { w, _ in
if let ellipsize { w.setEllipsize(mode: ellipsize) }
if let fraction { w.setFraction(fraction: fraction) }
if let inverted { w.setInverted(inverted: inverted) }
if let pulseStep { w.setPulseStep(fraction: pulseStep) }
if let showText { w.setShowText(showText: showText) }
if let text { w.setText(text: text) }
}
}
}
extension ProgressBar: WidgetView {
public typealias Target = Gtk.ProgressBar
@_spi(Portico) public func appending(
_ step: @escaping (Gtk.ProgressBar, MountContext) -> Void
) -> Self {
var c = self
c.configure.append(step)
return c
}
}
@_spi(Portico) extension ProgressBar: 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.ProgressBar
/// Modifiers for `Gtk.ProgressBar`, available on every Portico view whose
/// backing widget is `Gtk.ProgressBar` or one of its subclasses.
extension WidgetView where Target: Gtk.ProgressBar {
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ProgressBar.setEllipsize(mode:)
/// Sets the mode used to ellipsize the text.
///
/// The text is ellipsized if there is not enough space
/// to render the entire string.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter ellipsize: The preferred place to ellipsize the string.
/// - Returns: A copy of this view with the modifier applied.
public func ellipsize(_ ellipsize: Gtk.EllipsizeMode) -> Self {
appending { w, _ in
w.setEllipsize(mode: ellipsize)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ProgressBar.setEllipsize(mode:), GObject.Object.connectNotify(detail:_:), Gtk.ProgressBar.getEllipsize()
/// Sets the mode used to ellipsize the text.
///
/// The text is ellipsized if there is not enough space
/// to render the entire string.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Gtk.EllipsizeMode` 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 ellipsize(_ ellipsize: Portico.Binding<Gtk.EllipsizeMode>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, ellipsize, registry: ctx.registry, notifyDetail: "ellipsize",
read: { [w] in w.getEllipsize() },
write: { [w] v in w.setEllipsize(mode: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ProgressBar.setEllipsize(mode:)
/// Sets the mode used to ellipsize the text.
///
/// The text is ellipsized if there is not enough space
/// to render the entire string.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ProgressBar.setEllipsize(mode:)`.
///
/// - Parameter ellipsize: The preferred place to ellipsize the string.
/// - Returns: A copy of this view with the modifier applied.
public func ellipsize(_ ellipsize: @escaping () -> Gtk.EllipsizeMode) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setEllipsize(mode: ellipsize()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ProgressBar.setFraction(fraction:)
/// Causes the progress bar to fill in the given fraction
/// of the bar.
///
/// The fraction should be between 0.0 and 1.0, inclusive.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter fraction: The fraction of total work that has been completed.
/// - Returns: A copy of this view with the modifier applied.
public func fraction(_ fraction: Double) -> Self {
appending { w, _ in
w.setFraction(fraction: fraction)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ProgressBar.setFraction(fraction:), GObject.Object.connectNotify(detail:_:), Gtk.ProgressBar.getFraction()
/// Causes the progress bar to fill in the given fraction
/// of the bar.
///
/// The fraction should be between 0.0 and 1.0, inclusive.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Double` 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 fraction(_ fraction: Portico.Binding<Double>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, fraction, registry: ctx.registry, notifyDetail: "fraction",
read: { [w] in w.getFraction() },
write: { [w] v in w.setFraction(fraction: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ProgressBar.setFraction(fraction:)
/// Causes the progress bar to fill in the given fraction
/// of the bar.
///
/// The fraction should be between 0.0 and 1.0, inclusive.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ProgressBar.setFraction(fraction:)`.
///
/// - Parameter fraction: The fraction of total work that has been completed.
/// - Returns: A copy of this view with the modifier applied.
public func fraction(_ fraction: @escaping () -> Double) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setFraction(fraction: fraction()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ProgressBar.setInverted(inverted:)
/// Sets whether the progress bar is inverted.
///
/// Progress bars normally grow from top to bottom or left to right.
/// Inverted progress bars grow in the opposite direction.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter inverted: Invert the direction in which the progress bar grows.
/// - Returns: A copy of this view with the modifier applied.
public func inverted(_ inverted: Bool) -> Self {
appending { w, _ in
w.setInverted(inverted: inverted)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ProgressBar.setInverted(inverted:), GObject.Object.connectNotify(detail:_:), Gtk.ProgressBar.getInverted()
/// Sets whether the progress bar is inverted.
///
/// Progress bars normally grow from top to bottom or left to right.
/// Inverted progress bars grow in the opposite direction.
///
/// 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 inverted(_ inverted: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, inverted, registry: ctx.registry, notifyDetail: "inverted",
read: { [w] in w.getInverted() },
write: { [w] v in w.setInverted(inverted: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ProgressBar.setInverted(inverted:)
/// Sets whether the progress bar is inverted.
///
/// Progress bars normally grow from top to bottom or left to right.
/// Inverted progress bars grow in the opposite direction.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ProgressBar.setInverted(inverted:)`.
///
/// - Parameter inverted: Invert the direction in which the progress bar grows.
/// - Returns: A copy of this view with the modifier applied.
public func inverted(_ inverted: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setInverted(inverted: inverted()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ProgressBar.setPulseStep(fraction:)
/// Sets the fraction of total progress bar length to move the
/// bouncing block.
///
/// The bouncing block is moved when [method`Gtk`.ProgressBar.pulse]
/// is called.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter pulseStep: The fraction of total progress to move the bounding block when pulsed.
/// - Returns: A copy of this view with the modifier applied.
public func pulseStep(_ pulseStep: Double) -> Self {
appending { w, _ in
w.setPulseStep(fraction: pulseStep)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ProgressBar.setPulseStep(fraction:), GObject.Object.connectNotify(detail:_:), Gtk.ProgressBar.getPulseStep()
/// Sets the fraction of total progress bar length to move the
/// bouncing block.
///
/// The bouncing block is moved when [method`Gtk`.ProgressBar.pulse]
/// is called.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Double` 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 pulseStep(_ pulseStep: Portico.Binding<Double>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, pulseStep, registry: ctx.registry, notifyDetail: "pulse-step",
read: { [w] in w.getPulseStep() },
write: { [w] v in w.setPulseStep(fraction: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ProgressBar.setPulseStep(fraction:)
/// Sets the fraction of total progress bar length to move the
/// bouncing block.
///
/// The bouncing block is moved when [method`Gtk`.ProgressBar.pulse]
/// is called.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ProgressBar.setPulseStep(fraction:)`.
///
/// - Parameter pulseStep: The fraction of total progress to move the bounding block when pulsed.
/// - Returns: A copy of this view with the modifier applied.
public func pulseStep(_ pulseStep: @escaping () -> Double) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setPulseStep(fraction: pulseStep()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ProgressBar.setShowText(showText:)
/// Sets whether the progress bar will show text next to the bar.
///
/// The shown text is either the value of the [property`Gtk`.ProgressBar:text]
/// property or, if that is `nil`, the [property`Gtk`.ProgressBar:fraction] value,
/// as a percentage.
///
/// To make a progress bar that is styled and sized suitably for containing
/// text (even if the actual text is blank), set [property`Gtk`.ProgressBar:show-text]
/// to `true` and [property`Gtk`.ProgressBar:text] to the empty string (not `nil`).
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter showText: Sets whether the progress bar will show a text in addition to the bar itself.
/// - Returns: A copy of this view with the modifier applied.
public func showText(_ showText: Bool) -> Self {
appending { w, _ in
w.setShowText(showText: showText)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ProgressBar.setShowText(showText:), GObject.Object.connectNotify(detail:_:), Gtk.ProgressBar.getShowText()
/// Sets whether the progress bar will show text next to the bar.
///
/// The shown text is either the value of the [property`Gtk`.ProgressBar:text]
/// property or, if that is `nil`, the [property`Gtk`.ProgressBar:fraction] value,
/// as a percentage.
///
/// To make a progress bar that is styled and sized suitably for containing
/// text (even if the actual text is blank), set [property`Gtk`.ProgressBar:show-text]
/// to `true` and [property`Gtk`.ProgressBar:text] to the empty string (not `nil`).
///
/// 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 showText(_ showText: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, showText, registry: ctx.registry, notifyDetail: "show-text",
read: { [w] in w.getShowText() },
write: { [w] v in w.setShowText(showText: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ProgressBar.setShowText(showText:)
/// Sets whether the progress bar will show text next to the bar.
///
/// The shown text is either the value of the [property`Gtk`.ProgressBar:text]
/// property or, if that is `nil`, the [property`Gtk`.ProgressBar:fraction] value,
/// as a percentage.
///
/// To make a progress bar that is styled and sized suitably for containing
/// text (even if the actual text is blank), set [property`Gtk`.ProgressBar:show-text]
/// to `true` and [property`Gtk`.ProgressBar:text] to the empty string (not `nil`).
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ProgressBar.setShowText(showText:)`.
///
/// - Parameter showText: Sets whether the progress bar will show a text in addition to the bar itself.
/// - Returns: A copy of this view with the modifier applied.
public func showText(_ showText: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setShowText(showText: showText()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.ProgressBar.setText(text:)
/// Causes the given `text` to appear next to the progress bar.
///
/// If `text` is `nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the current value of [property`Gtk`.ProgressBar:fraction] will be displayed
/// as a percentage.
///
/// If `text` is non-`nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the text will be displayed. In this case, it will not display the progress
/// percentage. If `text` is the empty string, the progress bar will still
/// be styled and sized suitably for containing text, as long as
/// [property`Gtk`.ProgressBar:show-text] is `true`.
///
/// Applied once at mount; use the `Binding`, closure, or `InterpolatedText` overload for a value that changes.
/// A string literal containing interpolation selects the `InterpolatedText` overload instead, which updates live.
///
/// - Parameter text: Text to be displayed in the progress bar.
/// - Returns: A copy of this view with the modifier applied.
@_disfavoredOverload
public func text<S: StringProtocol>(_ text: S?) -> Self {
appending { w, _ in
w.setText(text: text.map { String($0) })
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.ProgressBar.setText(text:), GObject.Object.connectNotify(detail:_:), Gtk.ProgressBar.getText()
/// Causes the given `text` to appear next to the progress bar.
///
/// If `text` is `nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the current value of [property`Gtk`.ProgressBar:fraction] will be displayed
/// as a percentage.
///
/// If `text` is non-`nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the text will be displayed. In this case, it will not display the progress
/// percentage. If `text` is the empty string, the progress bar will still
/// be styled and sized suitably for containing text, as long as
/// [property`Gtk`.ProgressBar:show-text] is `true`.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `String?` 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 text(_ text: Portico.Binding<String?>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, text, registry: ctx.registry, notifyDetail: "text",
read: { [w] in w.getText() },
write: { [w] v in w.setText(text: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(lifted,twoWay) | source: Gtk.ProgressBar.setText(text:), GObject.Object.connectNotify(detail:_:), Gtk.ProgressBar.getText()
/// Causes the given `text` to appear next to the progress bar.
///
/// If `text` is `nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the current value of [property`Gtk`.ProgressBar:fraction] will be displayed
/// as a percentage.
///
/// If `text` is non-`nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the text will be displayed. In this case, it will not display the progress
/// percentage. If `text` is the empty string, the progress bar will still
/// be styled and sized suitably for containing text, as long as
/// [property`Gtk`.ProgressBar:show-text] is `true`.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// `Binding` is invariant, so a `Binding<String>` is not accepted by the nullable overload; this one takes it and promotes each value. Pass a `Binding<String?>` to be able to clear the property.
/// When `String` 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 text(_ text: Portico.Binding<String>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, text, registry: ctx.registry, notifyDetail: "text",
read: { [w] in w.getText() },
write: { [w] v in w.setText(text: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.ProgressBar.setText(text:)
/// Causes the given `text` to appear next to the progress bar.
///
/// If `text` is `nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the current value of [property`Gtk`.ProgressBar:fraction] will be displayed
/// as a percentage.
///
/// If `text` is non-`nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the text will be displayed. In this case, it will not display the progress
/// percentage. If `text` is the empty string, the progress bar will still
/// be styled and sized suitably for containing text, as long as
/// [property`Gtk`.ProgressBar:show-text] is `true`.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.ProgressBar.setText(text:)`.
///
/// - Parameter text: Text to be displayed in the progress bar.
/// - Returns: A copy of this view with the modifier applied.
public func text(_ text: @escaping () -> String?) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setText(text: text()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(interpolation) | source: Gtk.ProgressBar.setText(text:)
/// Causes the given `text` to appear next to the progress bar.
///
/// If `text` is `nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the current value of [property`Gtk`.ProgressBar:fraction] will be displayed
/// as a percentage.
///
/// If `text` is non-`nil` and [property`Gtk`.ProgressBar:show-text] is `true`,
/// the text will be displayed. In this case, it will not display the progress
/// percentage. If `text` is the empty string, the progress bar will still
/// be styled and sized suitably for containing text, as long as
/// [property`Gtk`.ProgressBar:show-text] is `true`.
///
/// Interpolated segments are captured unevaluated and re-read inside a `DependencyTracker`, so any `@State` they read pushes a new value through `Gtk.ProgressBar.setText(text:)`. A literal with no interpolation is applied once, with no subscription.
///
/// - Parameter text: Text to be displayed in the progress bar.
/// - Returns: A copy of this view with the modifier applied.
public func text(_ text: Portico.InterpolatedText?) -> Self {
appending { w, ctx in
Portico.bindOptionalInterpolation(text, registry: ctx.registry) { [w] v in w.setText(text: v) }
}
}
}