forked from aparoksha/adwaita-swift
Improve autogenerated docs
This commit is contained in:
parent
f86e968028
commit
fd29eccd68
@ -2,15 +2,15 @@
|
||||
// ActionRow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// A [class@Gtk.ListBoxRow] used to present actions.
|
||||
/// A `Gtk.ListBoxRow` used to present actions.
|
||||
///
|
||||
///
|
||||
/// <picture><source srcset="action-row-dark.png" media="(prefers-color-scheme: dark)"><img src="action-row.png" alt="action-row"></picture>
|
||||
///
|
||||
/// The `AdwActionRow` widget can have a title, a subtitle and an icon. The row
|
||||
/// can receive additional widgets at its end, or prefix widgets at its start.
|
||||
@ -21,35 +21,7 @@ import LevenshteinTransformations
|
||||
/// will automatically make it activatable, but unsetting it won't change the
|
||||
/// row's activatability.
|
||||
///
|
||||
/// ## AdwActionRow as GtkBuildable
|
||||
///
|
||||
/// The `AdwActionRow` implementation of the [iface@Gtk.Buildable] interface
|
||||
/// supports adding a child at its end by specifying “suffix” or omitting the
|
||||
/// “type” attribute of a <child> element.
|
||||
///
|
||||
/// It also supports adding a child as a prefix widget by specifying “prefix” as
|
||||
/// the “type” attribute of a <child> element.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwActionRow` has a main CSS node with name `row`.
|
||||
///
|
||||
/// It contains the subnode `box.header` for its main horizontal box, and
|
||||
/// `box.title` for the vertical box containing the title and subtitle labels.
|
||||
///
|
||||
/// It contains subnodes `label.title` and `label.subtitle` representing
|
||||
/// respectively the title label and subtitle label.
|
||||
///
|
||||
/// ## Style classes
|
||||
///
|
||||
/// `AdwActionRow` can use the [`.property`](style-classes.html#property-rows)
|
||||
/// style class to emphasize the row subtitle instead of the row title, which is
|
||||
/// useful for displaying read-only properties.
|
||||
///
|
||||
/// <picture><source srcset="property-row-dark.png" media="(prefers-color-scheme: dark)"><img src="property-row.png" alt="property-row"></picture>
|
||||
///
|
||||
/// When used together with the `.monospace` style class, only the subtitle
|
||||
/// becomes monospace, not the title or any extra widgets.
|
||||
public struct ActionRow: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -60,17 +32,17 @@ public struct ActionRow: AdwaitaWidget {
|
||||
/// The widget to activate when the row is activated.
|
||||
///
|
||||
/// The row can be activated either by clicking on it, calling
|
||||
/// [method@ActionRow.activate], or via mnemonics in the title.
|
||||
/// See the [property@PreferencesRow:use-underline] property to enable
|
||||
/// `ActionRow.activate`, or via mnemonics in the title.
|
||||
/// See the ``useUnderline(_:)`` property to enable
|
||||
/// mnemonics.
|
||||
///
|
||||
/// The target widget will be activated by emitting the
|
||||
/// [signal@Gtk.Widget::mnemonic-activate] signal on it.
|
||||
/// `Gtk.Widget::mnemonic-activate` signal on it.
|
||||
var activatableWidget: (() -> Body)?
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var subtitle: String?
|
||||
/// The number of lines at the end of which the subtitle label will be
|
||||
/// ellipsized.
|
||||
@ -79,12 +51,12 @@ public struct ActionRow: AdwaitaWidget {
|
||||
var subtitleLines: Int?
|
||||
/// Whether the user can copy the subtitle from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var subtitleSelectable: Bool?
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var title: String?
|
||||
/// The number of lines at the end of which the title label will be ellipsized.
|
||||
///
|
||||
@ -92,13 +64,13 @@ public struct ActionRow: AdwaitaWidget {
|
||||
var titleLines: Int?
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var titleSelectable: Bool?
|
||||
/// Whether to use Pango markup for the title label.
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// Whether an embedded underline in the title indicates a mnemonic.
|
||||
var useUnderline: Bool?
|
||||
@ -224,12 +196,12 @@ public struct ActionRow: AdwaitaWidget {
|
||||
/// The widget to activate when the row is activated.
|
||||
///
|
||||
/// The row can be activated either by clicking on it, calling
|
||||
/// [method@ActionRow.activate], or via mnemonics in the title.
|
||||
/// See the [property@PreferencesRow:use-underline] property to enable
|
||||
/// `ActionRow.activate`, or via mnemonics in the title.
|
||||
/// See the ``useUnderline(_:)`` property to enable
|
||||
/// mnemonics.
|
||||
///
|
||||
/// The target widget will be activated by emitting the
|
||||
/// [signal@Gtk.Widget::mnemonic-activate] signal on it.
|
||||
/// `Gtk.Widget::mnemonic-activate` signal on it.
|
||||
public func activatableWidget(@ViewBuilder _ activatableWidget: @escaping (() -> Body)) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.activatableWidget = activatableWidget
|
||||
@ -239,7 +211,7 @@ public struct ActionRow: AdwaitaWidget {
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func subtitle(_ subtitle: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitle = subtitle
|
||||
@ -258,7 +230,7 @@ public struct ActionRow: AdwaitaWidget {
|
||||
|
||||
/// Whether the user can copy the subtitle from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func subtitleSelectable(_ subtitleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitleSelectable = subtitleSelectable
|
||||
@ -268,7 +240,7 @@ public struct ActionRow: AdwaitaWidget {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func title(_ title: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -286,7 +258,7 @@ public struct ActionRow: AdwaitaWidget {
|
||||
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func titleSelectable(_ titleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.titleSelectable = titleSelectable
|
||||
@ -297,7 +269,7 @@ public struct ActionRow: AdwaitaWidget {
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// AspectFrame.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -13,15 +13,7 @@ import LevenshteinTransformations
|
||||
/// 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.
|
||||
public struct AspectFrame: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -40,7 +32,7 @@ public struct AspectFrame: AdwaitaWidget {
|
||||
/// The aspect ratio to be used by the `GtkAspectFrame`.
|
||||
///
|
||||
/// This property is only used if
|
||||
/// [property@Gtk.AspectFrame:obey-child] is set to %FALSE.
|
||||
/// ``obeyChild(_:)`` is set to `false`.
|
||||
var ratio: Float
|
||||
/// The horizontal alignment of the child.
|
||||
var xalign: Float?
|
||||
@ -133,7 +125,7 @@ public struct AspectFrame: AdwaitaWidget {
|
||||
/// The aspect ratio to be used by the `GtkAspectFrame`.
|
||||
///
|
||||
/// This property is only used if
|
||||
/// [property@Gtk.AspectFrame:obey-child] is set to %FALSE.
|
||||
/// ``obeyChild(_:)`` is set to `false`.
|
||||
public func ratio(_ ratio: Float) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.ratio = ratio
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Avatar.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,28 +10,22 @@ import LevenshteinTransformations
|
||||
|
||||
/// A widget displaying an image, with a generated fallback.
|
||||
///
|
||||
/// <picture><source srcset="avatar-dark.png" media="(prefers-color-scheme: dark)"><img src="avatar.png" alt="avatar"></picture>
|
||||
///
|
||||
///
|
||||
/// `AdwAvatar` is a widget that shows a round avatar.
|
||||
///
|
||||
/// `AdwAvatar` generates an avatar with the initials of the
|
||||
/// [property@Avatar:text] on top of a colored background.
|
||||
/// ``text(_:)`` on top of a colored background.
|
||||
///
|
||||
/// The color is picked based on the hash of the [property@Avatar:text].
|
||||
/// The color is picked based on the hash of the ``text(_:)``.
|
||||
///
|
||||
/// If [property@Avatar:show-initials] is set to `FALSE`,
|
||||
/// [property@Avatar:icon-name] or `avatar-default-symbolic` is shown instead of
|
||||
/// If ``showInitials(_:)`` is set to `false`,
|
||||
/// ``iconName(_:)`` or `avatar-default-symbolic` is shown instead of
|
||||
/// the initials.
|
||||
///
|
||||
/// Use [property@Avatar:custom-image] to set a custom image.
|
||||
/// Use ``customImage(_:)`` to set a custom image.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwAvatar` has a single CSS node with name `avatar`.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwAvatar` uses the `GTK_ACCESSIBLE_ROLE_IMG` role.
|
||||
public struct Avatar: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -45,14 +39,14 @@ public struct Avatar: AdwaitaWidget {
|
||||
var iconName: String?
|
||||
/// Whether initials are used instead of an icon on the fallback avatar.
|
||||
///
|
||||
/// See [property@Avatar:icon-name] for how to change the fallback icon.
|
||||
/// See ``iconName(_:)`` for how to change the fallback icon.
|
||||
var showInitials: Bool
|
||||
/// The size of the avatar.
|
||||
var size: Int
|
||||
/// Sets the text used to generate the fallback initials and color.
|
||||
///
|
||||
/// It's only used to generate the color if [property@Avatar:show-initials] is
|
||||
/// `FALSE`.
|
||||
/// It's only used to generate the color if ``showInitials(_:)`` is
|
||||
/// `false`.
|
||||
var text: String?
|
||||
|
||||
/// Initialize `Avatar`.
|
||||
@ -120,7 +114,7 @@ public struct Avatar: AdwaitaWidget {
|
||||
|
||||
/// Whether initials are used instead of an icon on the fallback avatar.
|
||||
///
|
||||
/// See [property@Avatar:icon-name] for how to change the fallback icon.
|
||||
/// See ``iconName(_:)`` for how to change the fallback icon.
|
||||
public func showInitials(_ showInitials: Bool) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.showInitials = showInitials
|
||||
@ -136,8 +130,8 @@ public struct Avatar: AdwaitaWidget {
|
||||
|
||||
/// Sets the text used to generate the fallback initials and color.
|
||||
///
|
||||
/// It's only used to generate the color if [property@Avatar:show-initials] is
|
||||
/// `FALSE`.
|
||||
/// It's only used to generate the color if ``showInitials(_:)`` is
|
||||
/// `false`.
|
||||
public func text(_ text: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.text = text
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Banner.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,26 +10,24 @@ import LevenshteinTransformations
|
||||
|
||||
/// A bar with contextual information.
|
||||
///
|
||||
/// <picture><source srcset="banner-dark.png" media="(prefers-color-scheme: dark)"><img src="banner.png" alt="banner"></picture>
|
||||
///
|
||||
/// Banners are hidden by default, use [property@Banner:revealed] to show them.
|
||||
///
|
||||
/// Banners have a title, set with [property@Banner:title]. Titles can be marked
|
||||
/// up with Pango markup, use [property@Banner:use-markup] to enable it.
|
||||
/// Banners are hidden by default, use ``revealed(_:)`` to show them.
|
||||
///
|
||||
/// Banners have a title, set with ``title(_:)``. Titles can be marked
|
||||
/// up with Pango markup, use ``useMarkup(_:)`` to enable it.
|
||||
///
|
||||
/// The title will be shown centered or left-aligned depending on available
|
||||
/// space.
|
||||
///
|
||||
/// Banners can optionally have a button with text on it, set through
|
||||
/// [property@Banner:button-label]. The button can be used with a `GAction`,
|
||||
/// or with the [signal@Banner::button-clicked] signal. The button can have
|
||||
/// ``buttonLabel(_:)``. The button can be used with a `GAction`,
|
||||
/// or with the `Banner::button-clicked` signal. The button can have
|
||||
/// different styles, a gray style and a suggested style.
|
||||
///
|
||||
/// <picture><source srcset="banner-suggested-dark.png" media="(prefers-color-scheme: dark)"><img src="banner-suggested.png" alt="banner with suggested button style"></picture>
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwBanner` has a main CSS node with the name `banner`.
|
||||
///
|
||||
public struct Banner: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -42,17 +40,17 @@ public struct Banner: AdwaitaWidget {
|
||||
/// If set to `""` or `NULL`, the button won't be shown.
|
||||
///
|
||||
/// The button can be used with a `GAction`, or with the
|
||||
/// [signal@Banner::button-clicked] signal.
|
||||
/// `Banner::button-clicked` signal.
|
||||
var buttonLabel: String?
|
||||
/// Whether the banner is currently revealed.
|
||||
var revealed: Bool?
|
||||
/// The title for this banner.
|
||||
///
|
||||
/// See also: [property@Banner:use-markup].
|
||||
/// See also: ``useMarkup(_:)``.
|
||||
var title: String
|
||||
/// Whether to use Pango markup for the banner title.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// This signal is emitted after the action button has been clicked.
|
||||
///
|
||||
@ -122,7 +120,7 @@ public struct Banner: AdwaitaWidget {
|
||||
/// If set to `""` or `NULL`, the button won't be shown.
|
||||
///
|
||||
/// The button can be used with a `GAction`, or with the
|
||||
/// [signal@Banner::button-clicked] signal.
|
||||
/// `Banner::button-clicked` signal.
|
||||
public func buttonLabel(_ buttonLabel: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.buttonLabel = buttonLabel
|
||||
@ -138,7 +136,7 @@ public struct Banner: AdwaitaWidget {
|
||||
|
||||
/// The title for this banner.
|
||||
///
|
||||
/// See also: [property@Banner:use-markup].
|
||||
/// See also: ``useMarkup(_:)``.
|
||||
public func title(_ title: String) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -147,7 +145,7 @@ public struct Banner: AdwaitaWidget {
|
||||
|
||||
/// Whether to use Pango markup for the banner title.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Bin.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,9 +10,9 @@ import LevenshteinTransformations
|
||||
|
||||
/// A widget with one child.
|
||||
///
|
||||
/// <picture><source srcset="bin-dark.png" media="(prefers-color-scheme: dark)"><img src="bin.png" alt="bin"></picture>
|
||||
///
|
||||
/// The `AdwBin` widget has only one child, set with the [property@Bin:child]
|
||||
///
|
||||
/// The `AdwBin` widget has only one child, set with the ``child(_:)``
|
||||
/// property.
|
||||
///
|
||||
/// It is useful for deriving subclasses, since it provides common code needed
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Box.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,38 +10,30 @@ import LevenshteinTransformations
|
||||
|
||||
/// Arranges child widgets into a single row or column.
|
||||
///
|
||||
/// <picture><source srcset="box-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkBox" src="box.png"></picture>
|
||||
///
|
||||
///
|
||||
/// Whether it is a row or column depends on the value of its
|
||||
/// [property@Gtk.Orientable:orientation] property. Within the other
|
||||
/// ``orientation(_:)`` property. Within the other
|
||||
/// dimension, all children are allocated the same size. The
|
||||
/// [property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
|
||||
/// ``halign(_:)`` and ``valign(_:)``
|
||||
/// properties can be used on the children to influence their allocation.
|
||||
///
|
||||
/// Use repeated calls to [method@Gtk.Box.append] to pack widgets into a
|
||||
/// `GtkBox` from start to end. Use [method@Gtk.Box.remove] to remove widgets
|
||||
/// from the `GtkBox`. [method@Gtk.Box.insert_child_after] can be used to add
|
||||
/// Use repeated calls to `Gtk.Box.append` to pack widgets into a
|
||||
/// `GtkBox` from start to end. Use `Gtk.Box.remove` to remove widgets
|
||||
/// from the `GtkBox`. `Gtk.Box.insert_child_after` can be used to add
|
||||
/// a child at a particular position.
|
||||
///
|
||||
/// Use [method@Gtk.Box.set_homogeneous] to specify whether or not all children
|
||||
/// Use `Gtk.Box.set_homogeneous` to specify whether or not all children
|
||||
/// of the `GtkBox` are forced to get the same amount of space.
|
||||
///
|
||||
/// Use [method@Gtk.Box.set_spacing] to determine how much space will be minimally
|
||||
/// Use `Gtk.Box.set_spacing` to determine how much space will be minimally
|
||||
/// placed between all children in the `GtkBox`. Note that spacing is added
|
||||
/// *between* the children.
|
||||
///
|
||||
/// Use [method@Gtk.Box.reorder_child_after] to move a child to a different
|
||||
/// Use `Gtk.Box.reorder_child_after` to move a child to a different
|
||||
/// place in the box.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// `GtkBox` uses a single CSS node with name box.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// Until GTK 4.10, `GtkBox` used the [enum@Gtk.AccessibleRole.group] role.
|
||||
///
|
||||
/// Starting from GTK 4.12, `GtkBox` uses the [enum@Gtk.AccessibleRole.generic] role.
|
||||
public struct Box: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Button.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,39 +10,13 @@ import LevenshteinTransformations
|
||||
|
||||
/// Calls a callback function when the button is clicked.
|
||||
///
|
||||
/// <picture><source srcset="button-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkButton" src="button.png"></picture>
|
||||
///
|
||||
///
|
||||
/// The `GtkButton` widget can hold any valid child widget. That is, it can hold
|
||||
/// almost any other standard `GtkWidget`. The most commonly used child is the
|
||||
/// `GtkLabel`.
|
||||
///
|
||||
/// # Shortcuts and Gestures
|
||||
///
|
||||
/// The following signals have default keybindings:
|
||||
///
|
||||
/// - [signal@Gtk.Button::activate]
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// `GtkButton` has a single CSS node with name button. The node will get the
|
||||
/// style classes .image-button or .text-button, if the content is just an
|
||||
/// image or label, respectively. It may also receive the .flat style class.
|
||||
/// When activating a button via the keyboard, the button will temporarily
|
||||
/// gain the .keyboard-activating style class.
|
||||
///
|
||||
/// Other style classes that are commonly used with `GtkButton` include
|
||||
/// .suggested-action and .destructive-action. In special cases, buttons
|
||||
/// can be made round by adding the .circular style class.
|
||||
///
|
||||
/// Button-like widgets like [class@Gtk.ToggleButton], [class@Gtk.MenuButton],
|
||||
/// [class@Gtk.VolumeButton], [class@Gtk.LockButton], [class@Gtk.ColorButton]
|
||||
/// or [class@Gtk.FontButton] use style classes such as .toggle, .popup, .scale,
|
||||
/// .lock, .color on the button node to differentiate themselves from a plain
|
||||
/// `GtkButton`.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkButton` uses the [enum@Gtk.AccessibleRole.button] role.
|
||||
public struct Button: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -78,7 +52,7 @@ public struct Button: AdwaitaWidget {
|
||||
/// Emitted to animate press then release.
|
||||
///
|
||||
/// This is an action signal. Applications should never connect
|
||||
/// to this signal, but use the [signal@Gtk.Button::clicked] signal.
|
||||
/// to this signal, but use the `Gtk.Button::clicked` signal.
|
||||
///
|
||||
/// The default bindings for this signal are all forms of the
|
||||
/// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
@ -229,7 +203,7 @@ public struct Button: AdwaitaWidget {
|
||||
/// Emitted to animate press then release.
|
||||
///
|
||||
/// This is an action signal. Applications should never connect
|
||||
/// to this signal, but use the [signal@Gtk.Button::clicked] signal.
|
||||
/// to this signal, but use the `Gtk.Button::clicked` signal.
|
||||
///
|
||||
/// The default bindings for this signal are all forms of the
|
||||
/// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// ButtonContent.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,12 +10,12 @@ import LevenshteinTransformations
|
||||
|
||||
/// A helper widget for creating buttons.
|
||||
///
|
||||
/// <picture><source srcset="button-content-dark.png" media="(prefers-color-scheme: dark)"><img src="button-content.png" alt="button-content"></picture>
|
||||
///
|
||||
///
|
||||
/// `AdwButtonContent` is a box-like widget with an icon and a label.
|
||||
///
|
||||
/// It's intended to be used as a direct child of [class@Gtk.Button],
|
||||
/// [class@Gtk.MenuButton] or [class@SplitButton], when they need to have both an
|
||||
/// It's intended to be used as a direct child of `Gtk.Button`,
|
||||
/// `Gtk.MenuButton` or `SplitButton`, when they need to have both an
|
||||
/// icon and a label, as follows:
|
||||
///
|
||||
/// ```xml
|
||||
@ -25,25 +25,7 @@ import LevenshteinTransformations
|
||||
/// `AdwButtonContent` handles style classes and connecting the mnemonic to the
|
||||
/// button automatically.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// buttoncontent
|
||||
/// ╰── box
|
||||
/// ├── image
|
||||
/// ╰── label
|
||||
/// ```
|
||||
///
|
||||
/// `AdwButtonContent`'s CSS node is called `buttoncontent`. It contains a `box`
|
||||
/// subnode that serves as a container for the `image` and `label` nodes.
|
||||
///
|
||||
/// When inside a `GtkButton` or `AdwSplitButton`, the button will receive the
|
||||
/// `.image-text-button` style class. When inside a `GtkMenuButton`, the
|
||||
/// internal `GtkButton` will receive it instead.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwButtonContent` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
|
||||
public struct ButtonContent: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -53,9 +35,9 @@ public struct ButtonContent: AdwaitaWidget {
|
||||
|
||||
/// Whether the button can be smaller than the natural size of its contents.
|
||||
///
|
||||
/// If set to `TRUE`, the label will ellipsize.
|
||||
/// If set to `true`, the label will ellipsize.
|
||||
///
|
||||
/// See [property@Gtk.Button:can-shrink].
|
||||
/// See ``canShrink(_:)``.
|
||||
var canShrink: Bool?
|
||||
/// The name of the displayed icon.
|
||||
///
|
||||
@ -67,7 +49,7 @@ public struct ButtonContent: AdwaitaWidget {
|
||||
///
|
||||
/// The mnemonic can be used to activate the parent button.
|
||||
///
|
||||
/// See [property@ButtonContent:label].
|
||||
/// See ``label(_:)``.
|
||||
var useUnderline: Bool?
|
||||
|
||||
/// Initialize `ButtonContent`.
|
||||
@ -124,9 +106,9 @@ public struct ButtonContent: AdwaitaWidget {
|
||||
|
||||
/// Whether the button can be smaller than the natural size of its contents.
|
||||
///
|
||||
/// If set to `TRUE`, the label will ellipsize.
|
||||
/// If set to `true`, the label will ellipsize.
|
||||
///
|
||||
/// See [property@Gtk.Button:can-shrink].
|
||||
/// See ``canShrink(_:)``.
|
||||
public func canShrink(_ canShrink: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.canShrink = canShrink
|
||||
@ -153,7 +135,7 @@ public struct ButtonContent: AdwaitaWidget {
|
||||
///
|
||||
/// The mnemonic can be used to activate the parent button.
|
||||
///
|
||||
/// See [property@ButtonContent:label].
|
||||
/// See ``label(_:)``.
|
||||
public func useUnderline(_ useUnderline: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useUnderline = useUnderline
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Carousel.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,17 +10,15 @@ import LevenshteinTransformations
|
||||
|
||||
/// A paginated scrolling widget.
|
||||
///
|
||||
/// <picture><source srcset="carousel-dark.png" media="(prefers-color-scheme: dark)"><img src="carousel.png" alt="carousel"></picture>
|
||||
///
|
||||
///
|
||||
/// The `AdwCarousel` widget can be used to display a set of pages with
|
||||
/// swipe-based navigation between them.
|
||||
///
|
||||
/// [class@CarouselIndicatorDots] and [class@CarouselIndicatorLines] can be used
|
||||
/// `CarouselIndicatorDots` and `CarouselIndicatorLines` can be used
|
||||
/// to provide page indicators for `AdwCarousel`.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwCarousel` has a single CSS node with name `carousel`.
|
||||
public struct Carousel<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -30,15 +28,15 @@ public struct Carousel<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
|
||||
/// Whether to allow swiping for more than one page at a time.
|
||||
///
|
||||
/// If the value is `FALSE`, each swipe can only move to the adjacent pages.
|
||||
/// If the value is `false`, each swipe can only move to the adjacent pages.
|
||||
var allowLongSwipes: Bool?
|
||||
/// Sets whether the `AdwCarousel` can be dragged with mouse pointer.
|
||||
///
|
||||
/// If the value is `FALSE`, dragging is only available on touch.
|
||||
/// If the value is `false`, dragging is only available on touch.
|
||||
var allowMouseDrag: Bool?
|
||||
/// Whether the widget will respond to scroll wheel events.
|
||||
///
|
||||
/// If the value is `FALSE`, wheel events will be ignored.
|
||||
/// If the value is `false`, wheel events will be ignored.
|
||||
var allowScrollWheel: Bool?
|
||||
/// Whether the carousel can be navigated.
|
||||
///
|
||||
@ -58,8 +56,8 @@ public struct Carousel<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
/// It can be used to implement "infinite scrolling" by amending the pages
|
||||
/// after every scroll.
|
||||
///
|
||||
/// ::: note
|
||||
/// An empty carousel is indicated by `(int)index == -1`.
|
||||
/// > [!NOTE]
|
||||
/// > An empty carousel is indicated by `(int)index == -1`.
|
||||
var pageChanged: (() -> Void)?
|
||||
/// The dynamic widget elements.
|
||||
var elements: [Element]
|
||||
@ -150,7 +148,7 @@ public struct Carousel<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
|
||||
/// Whether to allow swiping for more than one page at a time.
|
||||
///
|
||||
/// If the value is `FALSE`, each swipe can only move to the adjacent pages.
|
||||
/// If the value is `false`, each swipe can only move to the adjacent pages.
|
||||
public func allowLongSwipes(_ allowLongSwipes: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.allowLongSwipes = allowLongSwipes
|
||||
@ -159,7 +157,7 @@ public struct Carousel<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
|
||||
/// Sets whether the `AdwCarousel` can be dragged with mouse pointer.
|
||||
///
|
||||
/// If the value is `FALSE`, dragging is only available on touch.
|
||||
/// If the value is `false`, dragging is only available on touch.
|
||||
public func allowMouseDrag(_ allowMouseDrag: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.allowMouseDrag = allowMouseDrag
|
||||
@ -168,7 +166,7 @@ public struct Carousel<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
|
||||
/// Whether the widget will respond to scroll wheel events.
|
||||
///
|
||||
/// If the value is `FALSE`, wheel events will be ignored.
|
||||
/// If the value is `false`, wheel events will be ignored.
|
||||
public func allowScrollWheel(_ allowScrollWheel: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.allowScrollWheel = allowScrollWheel
|
||||
@ -213,8 +211,8 @@ public struct Carousel<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
/// It can be used to implement "infinite scrolling" by amending the pages
|
||||
/// after every scroll.
|
||||
///
|
||||
/// ::: note
|
||||
/// An empty carousel is indicated by `(int)index == -1`.
|
||||
/// > [!NOTE]
|
||||
/// > An empty carousel is indicated by `(int)index == -1`.
|
||||
public func pageChanged(_ pageChanged: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.pageChanged = pageChanged
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// CenterBox.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -11,38 +11,16 @@ import LevenshteinTransformations
|
||||
/// Arranges three children in a row, keeping the middle child
|
||||
/// centered as well as possible.
|
||||
///
|
||||
/// <picture><source srcset="centerbox-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkCenterBox" src="centerbox.png"></picture>
|
||||
///
|
||||
/// To add children to `GtkCenterBox`, use [method@Gtk.CenterBox.set_start_widget],
|
||||
/// [method@Gtk.CenterBox.set_center_widget] and
|
||||
/// [method@Gtk.CenterBox.set_end_widget].
|
||||
///
|
||||
/// To add children to `GtkCenterBox`, use `Gtk.CenterBox.set_start_widget`,
|
||||
/// `Gtk.CenterBox.set_center_widget` and
|
||||
/// `Gtk.CenterBox.set_end_widget`.
|
||||
///
|
||||
/// The sizing and positioning of children can be influenced with the
|
||||
/// align and expand properties of the children.
|
||||
///
|
||||
/// # GtkCenterBox as GtkBuildable
|
||||
///
|
||||
/// The `GtkCenterBox` implementation of the `GtkBuildable` interface
|
||||
/// supports placing children in the 3 positions by specifying “start”, “center”
|
||||
/// or “end” as the “type” attribute of a `<child>` element.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// `GtkCenterBox` uses a single CSS node with the name “box”,
|
||||
///
|
||||
/// The first child of the `GtkCenterBox` will be allocated depending on the
|
||||
/// text direction, i.e. in left-to-right layouts it will be allocated on the
|
||||
/// left and in right-to-left layouts on the right.
|
||||
///
|
||||
/// In vertical orientation, the nodes of the children are arranged from top to
|
||||
/// bottom.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// Until GTK 4.10, `GtkCenterBox` used the [enum@Gtk.AccessibleRole.group] role.
|
||||
///
|
||||
/// Starting from GTK 4.12, `GtkCenterBox` uses the [enum@Gtk.AccessibleRole.generic]
|
||||
/// role.
|
||||
public struct CenterBox: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// CheckButton.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,67 +10,16 @@ import LevenshteinTransformations
|
||||
|
||||
/// Places a label next to an indicator.
|
||||
///
|
||||
/// <picture><source srcset="check-button-dark.png" media="(prefers-color-scheme: dark)"><img alt="Example GtkCheckButtons" src="check-button.png"></picture>
|
||||
///
|
||||
/// A `GtkCheckButton` is created by calling either [ctor@Gtk.CheckButton.new]
|
||||
/// or [ctor@Gtk.CheckButton.new_with_label].
|
||||
///
|
||||
/// A `GtkCheckButton` is created by calling either `Gtk.CheckButton.new`
|
||||
/// or `Gtk.CheckButton.new_with_label`.
|
||||
///
|
||||
/// The state of a `GtkCheckButton` can be set specifically using
|
||||
/// [method@Gtk.CheckButton.set_active], and retrieved using
|
||||
/// [method@Gtk.CheckButton.get_active].
|
||||
/// `Gtk.CheckButton.set_active`, and retrieved using
|
||||
/// `Gtk.CheckButton.get_active`.
|
||||
///
|
||||
/// # Inconsistent state
|
||||
///
|
||||
/// In addition to "on" and "off", check buttons can be an
|
||||
/// "in between" state that is neither on nor off. This can be used
|
||||
/// e.g. when the user has selected a range of elements (such as some
|
||||
/// text or spreadsheet cells) that are affected by a check button,
|
||||
/// and the current values in that range are inconsistent.
|
||||
///
|
||||
/// To set a `GtkCheckButton` to inconsistent state, use
|
||||
/// [method@Gtk.CheckButton.set_inconsistent].
|
||||
///
|
||||
/// # Grouping
|
||||
///
|
||||
/// Check buttons can be grouped together, to form mutually exclusive
|
||||
/// groups - only one of the buttons can be toggled at a time, and toggling
|
||||
/// another one will switch the currently toggled one off.
|
||||
///
|
||||
/// Grouped check buttons use a different indicator, and are commonly referred
|
||||
/// to as *radio buttons*.
|
||||
///
|
||||
/// <picture><source srcset="radio-button-dark.png" media="(prefers-color-scheme: dark)"><img alt="Example GtkRadioButtons" src="radio-button.png"></picture>
|
||||
///
|
||||
/// To add a `GtkCheckButton` to a group, use [method@Gtk.CheckButton.set_group].
|
||||
///
|
||||
/// When the code must keep track of the state of a group of radio buttons, it
|
||||
/// is recommended to keep track of such state through a stateful
|
||||
/// `GAction` with a target for each button. Using the `toggled` signals to keep
|
||||
/// track of the group changes and state is discouraged.
|
||||
///
|
||||
/// # Shortcuts and Gestures
|
||||
///
|
||||
/// `GtkCheckButton` supports the following keyboard shortcuts:
|
||||
///
|
||||
/// - <kbd>␣</kbd> or <kbd>Enter</kbd> activates the button.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// checkbutton[.text-button][.grouped]
|
||||
/// ├── check
|
||||
/// ╰── [label]
|
||||
/// ```
|
||||
///
|
||||
/// A `GtkCheckButton` has a main node with name checkbutton. If the
|
||||
/// [property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child]
|
||||
/// properties are set, it contains a child widget. The indicator node
|
||||
/// is named check when no group is set, and radio if the checkbutton
|
||||
/// is grouped together with other checkbuttons.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkCheckButton` uses the [enum@Gtk.AccessibleRole.checkbox] role.
|
||||
public struct CheckButton: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -86,7 +35,7 @@ public struct CheckButton: AdwaitaWidget {
|
||||
var actionName: String?
|
||||
/// If the check button is active.
|
||||
///
|
||||
/// Setting `active` to %TRUE will add the `:checked:` state to both
|
||||
/// Setting `active` to `true` will add the `:checked:` state to both
|
||||
/// the check button and the indicator CSS node.
|
||||
var active: Binding<Bool>?
|
||||
/// The child widget.
|
||||
@ -107,12 +56,12 @@ public struct CheckButton: AdwaitaWidget {
|
||||
/// emitting it causes the button to animate press then release.
|
||||
///
|
||||
/// Applications should never connect to this signal, but use the
|
||||
/// [signal@Gtk.CheckButton::toggled] signal.
|
||||
/// `Gtk.CheckButton::toggled` signal.
|
||||
///
|
||||
/// The default bindings for this signal are all forms of the
|
||||
/// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
var activate: (() -> Void)?
|
||||
/// Emitted when the buttons's [property@Gtk.CheckButton:active]
|
||||
/// Emitted when the buttons's ``active(_:)``
|
||||
/// property changes.
|
||||
var toggled: (() -> Void)?
|
||||
|
||||
@ -212,7 +161,7 @@ if let active, newValue != active.wrappedValue {
|
||||
|
||||
/// If the check button is active.
|
||||
///
|
||||
/// Setting `active` to %TRUE will add the `:checked:` state to both
|
||||
/// Setting `active` to `true` will add the `:checked:` state to both
|
||||
/// the check button and the indicator CSS node.
|
||||
public func active(_ active: Binding<Bool>?) -> Self {
|
||||
var newSelf = self
|
||||
@ -258,7 +207,7 @@ if let active, newValue != active.wrappedValue {
|
||||
/// emitting it causes the button to animate press then release.
|
||||
///
|
||||
/// Applications should never connect to this signal, but use the
|
||||
/// [signal@Gtk.CheckButton::toggled] signal.
|
||||
/// `Gtk.CheckButton::toggled` signal.
|
||||
///
|
||||
/// The default bindings for this signal are all forms of the
|
||||
/// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
@ -268,7 +217,7 @@ if let active, newValue != active.wrappedValue {
|
||||
return newSelf
|
||||
}
|
||||
|
||||
/// Emitted when the buttons's [property@Gtk.CheckButton:active]
|
||||
/// Emitted when the buttons's ``active(_:)``
|
||||
/// property changes.
|
||||
public func toggled(_ toggled: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Clamp.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,7 +10,7 @@ import LevenshteinTransformations
|
||||
|
||||
/// A widget constraining its child to a given size.
|
||||
///
|
||||
/// <picture><source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"><img src="clamp-wide.png" alt="clamp-wide"></picture><picture><source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"><img src="clamp-narrow.png" alt="clamp-narrow"></picture>
|
||||
///
|
||||
///
|
||||
/// The `AdwClamp` widget constrains the size of the widget it contains to a
|
||||
/// given maximum size. It will constrain the width if it is horizontal, or the
|
||||
@ -21,13 +21,11 @@ import LevenshteinTransformations
|
||||
/// allocated the minimum size it can fit in instead.
|
||||
///
|
||||
/// `AdwClamp` can scale with the text scale factor, use the
|
||||
/// [property@Clamp:unit] property to enable that behavior.
|
||||
/// ``unit(_:)`` property to enable that behavior.
|
||||
///
|
||||
/// See also: [class@ClampLayout], [class@ClampScrollable].
|
||||
/// See also: `ClampLayout`, `ClampScrollable`.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwClamp` has a single CSS node with name `clamp`.
|
||||
public struct Clamp: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,15 +2,15 @@
|
||||
// ComboRow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// A [class@Gtk.ListBoxRow] used to choose from a list of items.
|
||||
/// A `Gtk.ListBoxRow` used to choose from a list of items.
|
||||
///
|
||||
///
|
||||
/// <picture><source srcset="combo-row-dark.png" media="(prefers-color-scheme: dark)"><img src="combo-row.png" alt="combo-row"></picture>
|
||||
///
|
||||
/// The `AdwComboRow` widget allows the user to choose from a list of valid
|
||||
/// choices. The row displays the selected choice. When activated, the row
|
||||
@ -21,26 +21,15 @@ import LevenshteinTransformations
|
||||
/// <object class="AdwComboRow"><property name="title" translatable="yes">Combo Row</property><property name="model"><object class="GtkStringList"><items><item translatable="yes">Foo</item><item translatable="yes">Bar</item><item translatable="yes">Baz</item></items></object></property></object>
|
||||
/// ```
|
||||
///
|
||||
/// The [property@ComboRow:selected] and [property@ComboRow:selected-item]
|
||||
/// The ``selected(_:)`` and ``selectedItem(_:)``
|
||||
/// properties can be used to keep track of the selected item and react to their
|
||||
/// changes.
|
||||
///
|
||||
/// `AdwComboRow` mirrors [class@Gtk.DropDown], see that widget for details.
|
||||
/// `AdwComboRow` mirrors `Gtk.DropDown`, see that widget for details.
|
||||
///
|
||||
/// `AdwComboRow` is [property@Gtk.ListBoxRow:activatable] if a model is set.
|
||||
/// `AdwComboRow` is ``activatable(_:)`` if a model is set.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwComboRow` has a main CSS node with name `row` and the `.combo` style
|
||||
/// class.
|
||||
///
|
||||
/// Its popover has the node named `popover` with the `.menu` style class, it
|
||||
/// contains a [class@Gtk.ScrolledWindow], which in turn contains a
|
||||
/// [class@Gtk.ListView], both are accessible via their regular nodes.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwComboRow` uses the `GTK_ACCESSIBLE_ROLE_COMBO_BOX` role.
|
||||
public struct ComboRow: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -51,29 +40,29 @@ public struct ComboRow: AdwaitaWidget {
|
||||
/// The widget to activate when the row is activated.
|
||||
///
|
||||
/// The row can be activated either by clicking on it, calling
|
||||
/// [method@ActionRow.activate], or via mnemonics in the title.
|
||||
/// See the [property@PreferencesRow:use-underline] property to enable
|
||||
/// `ActionRow.activate`, or via mnemonics in the title.
|
||||
/// See the ``useUnderline(_:)`` property to enable
|
||||
/// mnemonics.
|
||||
///
|
||||
/// The target widget will be activated by emitting the
|
||||
/// [signal@Gtk.Widget::mnemonic-activate] signal on it.
|
||||
/// `Gtk.Widget::mnemonic-activate` signal on it.
|
||||
var activatableWidget: (() -> Body)?
|
||||
/// Whether to show a search entry in the popup.
|
||||
///
|
||||
/// If set to `TRUE`, a search entry will be shown in the popup that
|
||||
/// If set to `true`, a search entry will be shown in the popup that
|
||||
/// allows to search for items in the list.
|
||||
///
|
||||
/// Search requires [property@ComboRow:expression] to be set.
|
||||
/// Search requires ``expression(_:)`` to be set.
|
||||
var enableSearch: Bool?
|
||||
/// The position of the selected item.
|
||||
///
|
||||
/// If no item is selected, the property has the value
|
||||
/// [const@Gtk.INVALID_LIST_POSITION]
|
||||
/// `Gtk.INVALID_LIST_POSITION`
|
||||
var selected: Binding<UInt>?
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var subtitle: String?
|
||||
/// The number of lines at the end of which the subtitle label will be
|
||||
/// ellipsized.
|
||||
@ -82,12 +71,12 @@ public struct ComboRow: AdwaitaWidget {
|
||||
var subtitleLines: Int?
|
||||
/// Whether the user can copy the subtitle from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var subtitleSelectable: Bool?
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var title: String?
|
||||
/// The number of lines at the end of which the title label will be ellipsized.
|
||||
///
|
||||
@ -95,23 +84,23 @@ public struct ComboRow: AdwaitaWidget {
|
||||
var titleLines: Int?
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var titleSelectable: Bool?
|
||||
/// Whether to use Pango markup for the title label.
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// Whether to use the current value as the subtitle.
|
||||
///
|
||||
/// If you use a custom list item factory, you will need to give the row a
|
||||
/// name conversion expression with [property@ComboRow:expression].
|
||||
/// name conversion expression with ``expression(_:)``.
|
||||
///
|
||||
/// If set to `TRUE`, you should not access [property@ActionRow:subtitle].
|
||||
/// If set to `true`, you should not access ``subtitle(_:)``.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup if
|
||||
/// [property@PreferencesRow:use-markup] is set to `TRUE`.
|
||||
/// ``useMarkup(_:)`` is set to `true`.
|
||||
var useSubtitle: Bool?
|
||||
/// Whether an embedded underline in the title indicates a mnemonic.
|
||||
var useUnderline: Bool?
|
||||
@ -228,12 +217,12 @@ if let selected, newValue != selected.wrappedValue {
|
||||
/// The widget to activate when the row is activated.
|
||||
///
|
||||
/// The row can be activated either by clicking on it, calling
|
||||
/// [method@ActionRow.activate], or via mnemonics in the title.
|
||||
/// See the [property@PreferencesRow:use-underline] property to enable
|
||||
/// `ActionRow.activate`, or via mnemonics in the title.
|
||||
/// See the ``useUnderline(_:)`` property to enable
|
||||
/// mnemonics.
|
||||
///
|
||||
/// The target widget will be activated by emitting the
|
||||
/// [signal@Gtk.Widget::mnemonic-activate] signal on it.
|
||||
/// `Gtk.Widget::mnemonic-activate` signal on it.
|
||||
public func activatableWidget(@ViewBuilder _ activatableWidget: @escaping (() -> Body)) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.activatableWidget = activatableWidget
|
||||
@ -242,10 +231,10 @@ if let selected, newValue != selected.wrappedValue {
|
||||
|
||||
/// Whether to show a search entry in the popup.
|
||||
///
|
||||
/// If set to `TRUE`, a search entry will be shown in the popup that
|
||||
/// If set to `true`, a search entry will be shown in the popup that
|
||||
/// allows to search for items in the list.
|
||||
///
|
||||
/// Search requires [property@ComboRow:expression] to be set.
|
||||
/// Search requires ``expression(_:)`` to be set.
|
||||
public func enableSearch(_ enableSearch: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.enableSearch = enableSearch
|
||||
@ -255,7 +244,7 @@ if let selected, newValue != selected.wrappedValue {
|
||||
/// The position of the selected item.
|
||||
///
|
||||
/// If no item is selected, the property has the value
|
||||
/// [const@Gtk.INVALID_LIST_POSITION]
|
||||
/// `Gtk.INVALID_LIST_POSITION`
|
||||
public func selected(_ selected: Binding<UInt>?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.selected = selected
|
||||
@ -265,7 +254,7 @@ if let selected, newValue != selected.wrappedValue {
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func subtitle(_ subtitle: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitle = subtitle
|
||||
@ -284,7 +273,7 @@ if let selected, newValue != selected.wrappedValue {
|
||||
|
||||
/// Whether the user can copy the subtitle from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func subtitleSelectable(_ subtitleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitleSelectable = subtitleSelectable
|
||||
@ -294,7 +283,7 @@ if let selected, newValue != selected.wrappedValue {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func title(_ title: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -312,7 +301,7 @@ if let selected, newValue != selected.wrappedValue {
|
||||
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func titleSelectable(_ titleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.titleSelectable = titleSelectable
|
||||
@ -323,7 +312,7 @@ if let selected, newValue != selected.wrappedValue {
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
@ -333,12 +322,12 @@ if let selected, newValue != selected.wrappedValue {
|
||||
/// Whether to use the current value as the subtitle.
|
||||
///
|
||||
/// If you use a custom list item factory, you will need to give the row a
|
||||
/// name conversion expression with [property@ComboRow:expression].
|
||||
/// name conversion expression with ``expression(_:)``.
|
||||
///
|
||||
/// If set to `TRUE`, you should not access [property@ActionRow:subtitle].
|
||||
/// If set to `true`, you should not access ``subtitle(_:)``.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup if
|
||||
/// [property@PreferencesRow:use-markup] is set to `TRUE`.
|
||||
/// ``useMarkup(_:)`` is set to `true`.
|
||||
public func useSubtitle(_ useSubtitle: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useSubtitle = useSubtitle
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// DropDown.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,27 +10,27 @@ import LevenshteinTransformations
|
||||
|
||||
/// Allows the user to choose an item from a list of options.
|
||||
///
|
||||
/// <picture><source srcset="drop-down-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkDropDown" src="drop-down.png"></picture>
|
||||
///
|
||||
/// The `GtkDropDown` displays the [selected][property@Gtk.DropDown:selected]
|
||||
///
|
||||
/// The `GtkDropDown` displays the [selected]``selected(_:)``
|
||||
/// choice.
|
||||
///
|
||||
/// The options are given to `GtkDropDown` in the form of `GListModel`
|
||||
/// and how the individual options are represented is determined by
|
||||
/// a [class@Gtk.ListItemFactory]. The default factory displays simple strings,
|
||||
/// a `Gtk.ListItemFactory`. The default factory displays simple strings,
|
||||
/// and adds a checkmark to the selected item in the popup.
|
||||
///
|
||||
/// To set your own factory, use [method@Gtk.DropDown.set_factory]. It is
|
||||
/// To set your own factory, use `Gtk.DropDown.set_factory`. It is
|
||||
/// possible to use a separate factory for the items in the popup, with
|
||||
/// [method@Gtk.DropDown.set_list_factory].
|
||||
/// `Gtk.DropDown.set_list_factory`.
|
||||
///
|
||||
/// `GtkDropDown` knows how to obtain strings from the items in a
|
||||
/// [class@Gtk.StringList]; for other models, you have to provide an expression
|
||||
/// to find the strings via [method@Gtk.DropDown.set_expression].
|
||||
/// `Gtk.StringList`; for other models, you have to provide an expression
|
||||
/// to find the strings via `Gtk.DropDown.set_expression`.
|
||||
///
|
||||
/// `GtkDropDown` can optionally allow search in the popup, which is
|
||||
/// useful if the list of options is long. To enable the search entry,
|
||||
/// use [method@Gtk.DropDown.set_enable_search].
|
||||
/// use `Gtk.DropDown.set_enable_search`.
|
||||
///
|
||||
/// Here is a UI definition example for `GtkDropDown` with a simple model:
|
||||
///
|
||||
@ -39,20 +39,13 @@ import LevenshteinTransformations
|
||||
/// ```
|
||||
///
|
||||
/// If a `GtkDropDown` is created in this manner, or with
|
||||
/// [ctor@Gtk.DropDown.new_from_strings], for instance, the object returned from
|
||||
/// [method@Gtk.DropDown.get_selected_item] will be a [class@Gtk.StringObject].
|
||||
/// `Gtk.DropDown.new_from_strings`, for instance, the object returned from
|
||||
/// `Gtk.DropDown.get_selected_item` will be a `Gtk.StringObject`.
|
||||
///
|
||||
/// To learn more about the list widget framework, see the
|
||||
/// [overview](section-list-widget.html).
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `GtkDropDown` has a single CSS node with name dropdown,
|
||||
/// with the button and popover nodes as children.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `GtkDropDown` uses the [enum@Gtk.AccessibleRole.combo_box] role.
|
||||
public struct DropDown: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -66,7 +59,7 @@ public struct DropDown: AdwaitaWidget {
|
||||
var accessibleRole: String?
|
||||
/// Whether to show a search entry in the popup.
|
||||
///
|
||||
/// Note that search requires [property@Gtk.DropDown:expression]
|
||||
/// Note that search requires ``expression(_:)``
|
||||
/// to be set.
|
||||
var enableSearch: Bool?
|
||||
/// The position of the selected item.
|
||||
@ -153,7 +146,7 @@ if let selected, newValue != selected.wrappedValue {
|
||||
|
||||
/// Whether to show a search entry in the popup.
|
||||
///
|
||||
/// Note that search requires [property@Gtk.DropDown:expression]
|
||||
/// Note that search requires ``expression(_:)``
|
||||
/// to be set.
|
||||
public func enableSearch(_ enableSearch: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Entry.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,33 +10,33 @@ import LevenshteinTransformations
|
||||
|
||||
/// A single-line text entry widget.
|
||||
///
|
||||
/// <picture><source srcset="entry-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkEntry" src="entry.png"></picture>
|
||||
///
|
||||
///
|
||||
/// A fairly large set of key bindings are supported by default. If the
|
||||
/// entered text is longer than the allocation of the widget, the widget
|
||||
/// will scroll so that the cursor position is visible.
|
||||
///
|
||||
/// When using an entry for passwords and other sensitive information, it
|
||||
/// can be put into “password mode” using [method@Gtk.Entry.set_visibility].
|
||||
/// can be put into “password mode” using `Gtk.Entry.set_visibility`.
|
||||
/// In this mode, entered text is displayed using a “invisible” character.
|
||||
/// By default, GTK picks the best invisible character that is available
|
||||
/// in the current font, but it can be changed with
|
||||
/// [method@Gtk.Entry.set_invisible_char].
|
||||
/// `Gtk.Entry.set_invisible_char`.
|
||||
///
|
||||
/// `GtkEntry` has the ability to display progress or activity
|
||||
/// information behind the text. To make an entry display such information,
|
||||
/// use [method@Gtk.Entry.set_progress_fraction] or
|
||||
/// [method@Gtk.Entry.set_progress_pulse_step].
|
||||
/// use `Gtk.Entry.set_progress_fraction` or
|
||||
/// `Gtk.Entry.set_progress_pulse_step`.
|
||||
///
|
||||
/// Additionally, `GtkEntry` can show icons at either side of the entry.
|
||||
/// These icons can be activatable by clicking, can be set up as drag source
|
||||
/// and can have tooltips. To add an icon, use
|
||||
/// [method@Gtk.Entry.set_icon_from_gicon] or one of the various other functions
|
||||
/// `Gtk.Entry.set_icon_from_gicon` or one of the various other functions
|
||||
/// that set an icon from an icon name or a paintable. To trigger an action when
|
||||
/// the user clicks an icon, connect to the [signal@Gtk.Entry::icon-press] signal.
|
||||
/// the user clicks an icon, connect to the `Gtk.Entry::icon-press` signal.
|
||||
/// To allow DND operations from an icon, use
|
||||
/// [method@Gtk.Entry.set_icon_drag_source]. To set a tooltip on an icon, use
|
||||
/// [method@Gtk.Entry.set_icon_tooltip_text] or the corresponding function
|
||||
/// `Gtk.Entry.set_icon_drag_source`. To set a tooltip on an icon, use
|
||||
/// `Gtk.Entry.set_icon_tooltip_text` or the corresponding function
|
||||
/// for markup.
|
||||
///
|
||||
/// Note that functionality or information that is only available by clicking
|
||||
@ -45,51 +45,7 @@ import LevenshteinTransformations
|
||||
/// that any such functionality should also be available by other means, e.g.
|
||||
/// via the context menu of the entry.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// entry[.flat][.warning][.error]
|
||||
/// ├── text[.readonly]
|
||||
/// ├── image.left
|
||||
/// ├── image.right
|
||||
/// ╰── [progress[.pulse]]
|
||||
/// ```
|
||||
///
|
||||
/// `GtkEntry` has a main node with the name entry. Depending on the properties
|
||||
/// of the entry, the style classes .read-only and .flat may appear. The style
|
||||
/// classes .warning and .error may also be used with entries.
|
||||
///
|
||||
/// When the entry shows icons, it adds subnodes with the name image and the
|
||||
/// style class .left or .right, depending on where the icon appears.
|
||||
///
|
||||
/// When the entry shows progress, it adds a subnode with the name progress.
|
||||
/// The node has the style class .pulse when the shown progress is pulsing.
|
||||
///
|
||||
/// For all the subnodes added to the text node in various situations,
|
||||
/// see [class@Gtk.Text].
|
||||
///
|
||||
/// # GtkEntry as GtkBuildable
|
||||
///
|
||||
/// The `GtkEntry` implementation of the `GtkBuildable` interface supports a
|
||||
/// custom `<attributes>` element, which supports any number of `<attribute>`
|
||||
/// elements. The `<attribute>` element has attributes named “name“, “value“,
|
||||
/// “start“ and “end“ and allows you to specify `PangoAttribute` values for
|
||||
/// this label.
|
||||
///
|
||||
/// An example of a UI definition fragment specifying Pango attributes:
|
||||
/// ```xml
|
||||
/// <object class="GtkEntry"><attributes><attribute name="weight" value="PANGO_WEIGHT_BOLD"/><attribute name="background" value="red" start="5" end="10"/></attributes></object>
|
||||
/// ```
|
||||
///
|
||||
/// The start and end attributes specify the range of characters to which the
|
||||
/// Pango attribute applies. If start and end are not specified, the attribute
|
||||
/// is applied to the whole text. Note that specifying ranges does not make much
|
||||
/// sense with translatable attributes. Use markup embedded in the translatable
|
||||
/// content instead.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkEntry` uses the [enum@Gtk.AccessibleRole.text_box] role.
|
||||
public struct Entry: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -118,10 +74,10 @@ public struct Entry: AdwaitaWidget {
|
||||
var hasFrame: Bool?
|
||||
/// Which IM (input method) module should be used for this entry.
|
||||
///
|
||||
/// See [class@Gtk.IMContext].
|
||||
/// See `Gtk.IMContext`.
|
||||
///
|
||||
/// Setting this to a non-%NULL value overrides the system-wide IM
|
||||
/// module setting. See the GtkSettings [property@Gtk.Settings:gtk-im-module]
|
||||
/// module setting. See the GtkSettings ``gtkImModule(_:)``
|
||||
/// property.
|
||||
var imModule: String?
|
||||
/// The character to use when masking entry contents (“password mode”).
|
||||
@ -132,6 +88,32 @@ public struct Entry: AdwaitaWidget {
|
||||
var maxLength: Int?
|
||||
/// The desired maximum width of the entry, in characters.
|
||||
var maxWidthChars: Int?
|
||||
/// Text for an item in the context menu to activate the primary icon action.
|
||||
///
|
||||
/// When the primary icon is activatable and this property has been set, a new entry
|
||||
/// in the context menu of this GtkEntry will appear with this text. Selecting that
|
||||
/// menu entry will result in the primary icon being activated, exactly in the same way
|
||||
/// as it would be activated from a mouse click.
|
||||
///
|
||||
/// This simplifies adding accessibility support to applications using activatable
|
||||
/// icons. The activatable icons aren't focusable when navigating the interface with
|
||||
/// the keyboard This is why Gtk recommends to also add those actions in the context
|
||||
/// menu. This set of methods greatly simplifies this, by adding a menu item that, when
|
||||
/// enabled, calls the same callback than clicking on the icon.
|
||||
var menuEntryIconPrimaryText: String?
|
||||
/// Text for an item in the context menu to activate the secondary icon action.
|
||||
///
|
||||
/// When the primary icon is activatable and this property has been set, a new entry
|
||||
/// in the context menu of this GtkEntry will appear with this text. Selecting that
|
||||
/// menu entry will result in the primary icon being activated, exactly in the same way
|
||||
/// as it would be activated from a mouse click.
|
||||
///
|
||||
/// This simplifies adding accessibility support to applications using activatable
|
||||
/// icons. The activatable icons aren't focusable when navigating the interface with
|
||||
/// the keyboard This is why Gtk recommends to also add those actions in the context
|
||||
/// menu. This set of methods greatly simplifies this, by adding a menu item that, when
|
||||
/// enabled, calls the same callback than clicking on the icon.
|
||||
var menuEntryIconSecondaryText: String?
|
||||
/// If text is overwritten when typing in the `GtkEntry`.
|
||||
var overwriteMode: Bool?
|
||||
/// The text that will be displayed in the `GtkEntry` when it is empty
|
||||
@ -139,8 +121,8 @@ public struct Entry: AdwaitaWidget {
|
||||
var placeholderText: String?
|
||||
/// Whether the primary icon is activatable.
|
||||
///
|
||||
/// GTK emits the [signal@Gtk.Entry::icon-press] and
|
||||
/// [signal@Gtk.Entry::icon-release] signals only on sensitive,
|
||||
/// GTK emits the `Gtk.Entry::icon-press` and
|
||||
/// `Gtk.Entry::icon-release` signals only on sensitive,
|
||||
/// activatable icons.
|
||||
///
|
||||
/// Sensitive, but non-activatable icons can be used for purely
|
||||
@ -151,7 +133,7 @@ public struct Entry: AdwaitaWidget {
|
||||
/// Whether the primary icon is sensitive.
|
||||
///
|
||||
/// An insensitive icon appears grayed out. GTK does not emit the
|
||||
/// [signal@Gtk.Entry::icon-press] and [signal@Gtk.Entry::icon-release]
|
||||
/// `Gtk.Entry::icon-press` and `Gtk.Entry::icon-release`
|
||||
/// signals and does not allow DND from insensitive icons.
|
||||
///
|
||||
/// An icon should be set insensitive if the action that would trigger
|
||||
@ -159,25 +141,25 @@ public struct Entry: AdwaitaWidget {
|
||||
var primaryIconSensitive: Bool?
|
||||
/// The contents of the tooltip on the primary icon, with markup.
|
||||
///
|
||||
/// Also see [method@Gtk.Entry.set_icon_tooltip_markup].
|
||||
/// Also see `Gtk.Entry.set_icon_tooltip_markup`.
|
||||
var primaryIconTooltipMarkup: String?
|
||||
/// The contents of the tooltip on the primary icon.
|
||||
///
|
||||
/// Also see [method@Gtk.Entry.set_icon_tooltip_text].
|
||||
/// Also see `Gtk.Entry.set_icon_tooltip_text`.
|
||||
var primaryIconTooltipText: String?
|
||||
/// The current fraction of the task that's been completed.
|
||||
var progressFraction: Double?
|
||||
/// The fraction of total entry width to move the progress
|
||||
/// bouncing block for each pulse.
|
||||
///
|
||||
/// See [method@Gtk.Entry.progress_pulse].
|
||||
/// See `Gtk.Entry.progress_pulse`.
|
||||
var progressPulseStep: Double?
|
||||
/// Number of pixels of the entry scrolled off the screen to the left.
|
||||
var scrollOffset: Int?
|
||||
/// Whether the secondary icon is activatable.
|
||||
///
|
||||
/// GTK emits the [signal@Gtk.Entry::icon-press] and
|
||||
/// [signal@Gtk.Entry::icon-release] signals only on sensitive,
|
||||
/// GTK emits the `Gtk.Entry::icon-press` and
|
||||
/// `Gtk.Entry::icon-release` signals only on sensitive,
|
||||
/// activatable icons.
|
||||
///
|
||||
/// Sensitive, but non-activatable icons can be used for purely
|
||||
@ -188,7 +170,7 @@ public struct Entry: AdwaitaWidget {
|
||||
/// Whether the secondary icon is sensitive.
|
||||
///
|
||||
/// An insensitive icon appears grayed out. GTK does not emit the
|
||||
/// [signal@Gtk.Entry::icon-press[ and [signal@Gtk.Entry::icon-release]
|
||||
/// `Gtk.Entry::icon-press[ and [signal@Gtk.Entry::icon-release`
|
||||
/// signals and does not allow DND from insensitive icons.
|
||||
///
|
||||
/// An icon should be set insensitive if the action that would trigger
|
||||
@ -196,11 +178,11 @@ public struct Entry: AdwaitaWidget {
|
||||
var secondaryIconSensitive: Bool?
|
||||
/// The contents of the tooltip on the secondary icon, with markup.
|
||||
///
|
||||
/// Also see [method@Gtk.Entry.set_icon_tooltip_markup].
|
||||
/// Also see `Gtk.Entry.set_icon_tooltip_markup`.
|
||||
var secondaryIconTooltipMarkup: String?
|
||||
/// The contents of the tooltip on the secondary icon.
|
||||
///
|
||||
/// Also see [method@Gtk.Entry.set_icon_tooltip_text].
|
||||
/// Also see `Gtk.Entry.set_icon_tooltip_text`.
|
||||
var secondaryIconTooltipText: String?
|
||||
/// The position of the opposite end of the selection from the cursor in chars.
|
||||
var selectionBound: Int?
|
||||
@ -211,7 +193,7 @@ public struct Entry: AdwaitaWidget {
|
||||
var text: Binding<String>?
|
||||
/// The length of the text in the `GtkEntry`.
|
||||
var textLength: UInt?
|
||||
/// When %TRUE, pasted multi-line text is truncated to the first line.
|
||||
/// When `true`, pasted multi-line text is truncated to the first line.
|
||||
var truncateMultiline: Bool?
|
||||
/// Whether the entry should show the “invisible char” instead of the
|
||||
/// actual text (“password mode”).
|
||||
@ -243,7 +225,7 @@ public struct Entry: AdwaitaWidget {
|
||||
/// range of deleted text, or prevent it from being deleted entirely.
|
||||
///
|
||||
/// The @start_pos and @end_pos parameters are interpreted as for
|
||||
/// [method@Gtk.Editable.delete_text].
|
||||
/// `Gtk.Editable.delete_text`.
|
||||
var deleteText: (() -> Void)?
|
||||
/// This signal is a sign for the cell renderer to update its
|
||||
/// value from the @cell_editable.
|
||||
@ -484,10 +466,10 @@ if let text, newValue != text.wrappedValue {
|
||||
|
||||
/// Which IM (input method) module should be used for this entry.
|
||||
///
|
||||
/// See [class@Gtk.IMContext].
|
||||
/// See `Gtk.IMContext`.
|
||||
///
|
||||
/// Setting this to a non-%NULL value overrides the system-wide IM
|
||||
/// module setting. See the GtkSettings [property@Gtk.Settings:gtk-im-module]
|
||||
/// module setting. See the GtkSettings ``gtkImModule(_:)``
|
||||
/// property.
|
||||
public func imModule(_ imModule: String?) -> Self {
|
||||
var newSelf = self
|
||||
@ -523,6 +505,42 @@ if let text, newValue != text.wrappedValue {
|
||||
return newSelf
|
||||
}
|
||||
|
||||
/// Text for an item in the context menu to activate the primary icon action.
|
||||
///
|
||||
/// When the primary icon is activatable and this property has been set, a new entry
|
||||
/// in the context menu of this GtkEntry will appear with this text. Selecting that
|
||||
/// menu entry will result in the primary icon being activated, exactly in the same way
|
||||
/// as it would be activated from a mouse click.
|
||||
///
|
||||
/// This simplifies adding accessibility support to applications using activatable
|
||||
/// icons. The activatable icons aren't focusable when navigating the interface with
|
||||
/// the keyboard This is why Gtk recommends to also add those actions in the context
|
||||
/// menu. This set of methods greatly simplifies this, by adding a menu item that, when
|
||||
/// enabled, calls the same callback than clicking on the icon.
|
||||
public func menuEntryIconPrimaryText(_ menuEntryIconPrimaryText: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.menuEntryIconPrimaryText = menuEntryIconPrimaryText
|
||||
return newSelf
|
||||
}
|
||||
|
||||
/// Text for an item in the context menu to activate the secondary icon action.
|
||||
///
|
||||
/// When the primary icon is activatable and this property has been set, a new entry
|
||||
/// in the context menu of this GtkEntry will appear with this text. Selecting that
|
||||
/// menu entry will result in the primary icon being activated, exactly in the same way
|
||||
/// as it would be activated from a mouse click.
|
||||
///
|
||||
/// This simplifies adding accessibility support to applications using activatable
|
||||
/// icons. The activatable icons aren't focusable when navigating the interface with
|
||||
/// the keyboard This is why Gtk recommends to also add those actions in the context
|
||||
/// menu. This set of methods greatly simplifies this, by adding a menu item that, when
|
||||
/// enabled, calls the same callback than clicking on the icon.
|
||||
public func menuEntryIconSecondaryText(_ menuEntryIconSecondaryText: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.menuEntryIconSecondaryText = menuEntryIconSecondaryText
|
||||
return newSelf
|
||||
}
|
||||
|
||||
/// If text is overwritten when typing in the `GtkEntry`.
|
||||
public func overwriteMode(_ overwriteMode: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
@ -540,8 +558,8 @@ if let text, newValue != text.wrappedValue {
|
||||
|
||||
/// Whether the primary icon is activatable.
|
||||
///
|
||||
/// GTK emits the [signal@Gtk.Entry::icon-press] and
|
||||
/// [signal@Gtk.Entry::icon-release] signals only on sensitive,
|
||||
/// GTK emits the `Gtk.Entry::icon-press` and
|
||||
/// `Gtk.Entry::icon-release` signals only on sensitive,
|
||||
/// activatable icons.
|
||||
///
|
||||
/// Sensitive, but non-activatable icons can be used for purely
|
||||
@ -562,7 +580,7 @@ if let text, newValue != text.wrappedValue {
|
||||
/// Whether the primary icon is sensitive.
|
||||
///
|
||||
/// An insensitive icon appears grayed out. GTK does not emit the
|
||||
/// [signal@Gtk.Entry::icon-press] and [signal@Gtk.Entry::icon-release]
|
||||
/// `Gtk.Entry::icon-press` and `Gtk.Entry::icon-release`
|
||||
/// signals and does not allow DND from insensitive icons.
|
||||
///
|
||||
/// An icon should be set insensitive if the action that would trigger
|
||||
@ -575,7 +593,7 @@ if let text, newValue != text.wrappedValue {
|
||||
|
||||
/// The contents of the tooltip on the primary icon, with markup.
|
||||
///
|
||||
/// Also see [method@Gtk.Entry.set_icon_tooltip_markup].
|
||||
/// Also see `Gtk.Entry.set_icon_tooltip_markup`.
|
||||
public func primaryIconTooltipMarkup(_ primaryIconTooltipMarkup: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.primaryIconTooltipMarkup = primaryIconTooltipMarkup
|
||||
@ -584,7 +602,7 @@ if let text, newValue != text.wrappedValue {
|
||||
|
||||
/// The contents of the tooltip on the primary icon.
|
||||
///
|
||||
/// Also see [method@Gtk.Entry.set_icon_tooltip_text].
|
||||
/// Also see `Gtk.Entry.set_icon_tooltip_text`.
|
||||
public func primaryIconTooltipText(_ primaryIconTooltipText: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.primaryIconTooltipText = primaryIconTooltipText
|
||||
@ -601,7 +619,7 @@ if let text, newValue != text.wrappedValue {
|
||||
/// The fraction of total entry width to move the progress
|
||||
/// bouncing block for each pulse.
|
||||
///
|
||||
/// See [method@Gtk.Entry.progress_pulse].
|
||||
/// See `Gtk.Entry.progress_pulse`.
|
||||
public func progressPulseStep(_ progressPulseStep: Double?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.progressPulseStep = progressPulseStep
|
||||
@ -617,8 +635,8 @@ if let text, newValue != text.wrappedValue {
|
||||
|
||||
/// Whether the secondary icon is activatable.
|
||||
///
|
||||
/// GTK emits the [signal@Gtk.Entry::icon-press] and
|
||||
/// [signal@Gtk.Entry::icon-release] signals only on sensitive,
|
||||
/// GTK emits the `Gtk.Entry::icon-press` and
|
||||
/// `Gtk.Entry::icon-release` signals only on sensitive,
|
||||
/// activatable icons.
|
||||
///
|
||||
/// Sensitive, but non-activatable icons can be used for purely
|
||||
@ -639,7 +657,7 @@ if let text, newValue != text.wrappedValue {
|
||||
/// Whether the secondary icon is sensitive.
|
||||
///
|
||||
/// An insensitive icon appears grayed out. GTK does not emit the
|
||||
/// [signal@Gtk.Entry::icon-press[ and [signal@Gtk.Entry::icon-release]
|
||||
/// `Gtk.Entry::icon-press[ and [signal@Gtk.Entry::icon-release`
|
||||
/// signals and does not allow DND from insensitive icons.
|
||||
///
|
||||
/// An icon should be set insensitive if the action that would trigger
|
||||
@ -652,7 +670,7 @@ if let text, newValue != text.wrappedValue {
|
||||
|
||||
/// The contents of the tooltip on the secondary icon, with markup.
|
||||
///
|
||||
/// Also see [method@Gtk.Entry.set_icon_tooltip_markup].
|
||||
/// Also see `Gtk.Entry.set_icon_tooltip_markup`.
|
||||
public func secondaryIconTooltipMarkup(_ secondaryIconTooltipMarkup: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.secondaryIconTooltipMarkup = secondaryIconTooltipMarkup
|
||||
@ -661,7 +679,7 @@ if let text, newValue != text.wrappedValue {
|
||||
|
||||
/// The contents of the tooltip on the secondary icon.
|
||||
///
|
||||
/// Also see [method@Gtk.Entry.set_icon_tooltip_text].
|
||||
/// Also see `Gtk.Entry.set_icon_tooltip_text`.
|
||||
public func secondaryIconTooltipText(_ secondaryIconTooltipText: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.secondaryIconTooltipText = secondaryIconTooltipText
|
||||
@ -697,7 +715,7 @@ if let text, newValue != text.wrappedValue {
|
||||
return newSelf
|
||||
}
|
||||
|
||||
/// When %TRUE, pasted multi-line text is truncated to the first line.
|
||||
/// When `true`, pasted multi-line text is truncated to the first line.
|
||||
public func truncateMultiline(_ truncateMultiline: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.truncateMultiline = truncateMultiline
|
||||
@ -759,7 +777,7 @@ if let text, newValue != text.wrappedValue {
|
||||
/// range of deleted text, or prevent it from being deleted entirely.
|
||||
///
|
||||
/// The @start_pos and @end_pos parameters are interpreted as for
|
||||
/// [method@Gtk.Editable.delete_text].
|
||||
/// `Gtk.Editable.delete_text`.
|
||||
public func deleteText(_ deleteText: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.deleteText = deleteText
|
||||
|
||||
@ -2,43 +2,31 @@
|
||||
// EntryRow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// A [class@Gtk.ListBoxRow] with an embedded text entry.
|
||||
/// A `Gtk.ListBoxRow` with an embedded text entry.
|
||||
///
|
||||
///
|
||||
/// <picture><source srcset="entry-row-dark.png" media="(prefers-color-scheme: dark)"><img src="entry-row.png" alt="entry-row"></picture>
|
||||
///
|
||||
/// `AdwEntryRow` has a title that doubles as placeholder text. It shows an icon
|
||||
/// indicating that it's editable and can receive additional widgets before or
|
||||
/// after the editable part.
|
||||
///
|
||||
/// If [property@EntryRow:show-apply-button] is set to `TRUE`, `AdwEntryRow` can
|
||||
/// If ``showApplyButton(_:)`` is set to `true`, `AdwEntryRow` can
|
||||
/// show an apply button when editing its contents. This can be useful if
|
||||
/// changing its contents can result in an expensive operation, such as network
|
||||
/// activity.
|
||||
///
|
||||
/// `AdwEntryRow` provides only minimal API and should be used with the
|
||||
/// [iface@Gtk.Editable] API.
|
||||
/// `Gtk.Editable` API.
|
||||
///
|
||||
/// See also [class@PasswordEntryRow].
|
||||
/// See also `PasswordEntryRow`.
|
||||
///
|
||||
/// ## AdwEntryRow as GtkBuildable
|
||||
///
|
||||
/// The `AdwEntryRow` implementation of the [iface@Gtk.Buildable] interface
|
||||
/// supports adding a child at its end by specifying “suffix” or omitting the
|
||||
/// “type” attribute of a <child> element.
|
||||
///
|
||||
/// It also supports adding a child as a prefix widget by specifying “prefix” as
|
||||
/// the “type” attribute of a <child> element.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwEntryRow` has a single CSS node with name `row` and the `.entry` style
|
||||
/// class.
|
||||
public struct EntryRow: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -56,9 +44,9 @@ public struct EntryRow: AdwaitaWidget {
|
||||
var maxLength: Int?
|
||||
/// Whether to show the apply button.
|
||||
///
|
||||
/// When set to `TRUE`, typing text in the entry will reveal an apply button.
|
||||
/// When set to `true`, typing text in the entry will reveal an apply button.
|
||||
/// Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
|
||||
/// emit the [signal@EntryRow::apply] signal.
|
||||
/// emit the `EntryRow::apply` signal.
|
||||
///
|
||||
/// This is useful if changing the entry contents can trigger an expensive
|
||||
/// operation, e.g. network activity, to avoid triggering it after typing every
|
||||
@ -69,23 +57,23 @@ public struct EntryRow: AdwaitaWidget {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var title: String?
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var titleSelectable: Bool?
|
||||
/// Whether to use Pango markup for the title label.
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// Whether an embedded underline in the title indicates a mnemonic.
|
||||
var useUnderline: Bool?
|
||||
/// Emitted when the apply button is pressed.
|
||||
///
|
||||
/// See [property@EntryRow:show-apply-button].
|
||||
/// See ``showApplyButton(_:)``.
|
||||
var apply: (() -> Void)?
|
||||
/// Emitted when the embedded entry is activated.
|
||||
var entryActivated: (() -> Void)?
|
||||
@ -229,9 +217,9 @@ public struct EntryRow: AdwaitaWidget {
|
||||
|
||||
/// Whether to show the apply button.
|
||||
///
|
||||
/// When set to `TRUE`, typing text in the entry will reveal an apply button.
|
||||
/// When set to `true`, typing text in the entry will reveal an apply button.
|
||||
/// Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
|
||||
/// emit the [signal@EntryRow::apply] signal.
|
||||
/// emit the `EntryRow::apply` signal.
|
||||
///
|
||||
/// This is useful if changing the entry contents can trigger an expensive
|
||||
/// operation, e.g. network activity, to avoid triggering it after typing every
|
||||
@ -252,7 +240,7 @@ public struct EntryRow: AdwaitaWidget {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func title(_ title: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -261,7 +249,7 @@ public struct EntryRow: AdwaitaWidget {
|
||||
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func titleSelectable(_ titleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.titleSelectable = titleSelectable
|
||||
@ -272,7 +260,7 @@ public struct EntryRow: AdwaitaWidget {
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
@ -288,7 +276,7 @@ public struct EntryRow: AdwaitaWidget {
|
||||
|
||||
/// Emitted when the apply button is pressed.
|
||||
///
|
||||
/// See [property@EntryRow:show-apply-button].
|
||||
/// See ``showApplyButton(_:)``.
|
||||
public func apply(_ apply: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.apply = apply
|
||||
|
||||
@ -2,46 +2,21 @@
|
||||
// ExpanderRow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// A [class@Gtk.ListBoxRow] used to reveal widgets.
|
||||
/// A `Gtk.ListBoxRow` used to reveal widgets.
|
||||
///
|
||||
///
|
||||
/// <picture><source srcset="expander-row-dark.png" media="(prefers-color-scheme: dark)"><img src="expander-row.png" alt="expander-row"></picture>
|
||||
///
|
||||
/// The `AdwExpanderRow` widget allows the user to reveal or hide widgets below
|
||||
/// it. It also allows the user to enable the expansion of the row, allowing to
|
||||
/// disable all that the row contains.
|
||||
///
|
||||
/// ## AdwExpanderRow as GtkBuildable
|
||||
///
|
||||
/// The `AdwExpanderRow` implementation of the [iface@Gtk.Buildable] interface
|
||||
/// supports adding a child as an suffix widget by specifying “suffix” as the
|
||||
/// “type” attribute of a <child> element.
|
||||
///
|
||||
/// It also supports adding it as a prefix widget by specifying “prefix” as the
|
||||
/// “type” attribute of a <child> element.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwExpanderRow` has a main CSS node with name `row` and the `.expander`
|
||||
/// style class. It has the `.empty` style class when it contains no children.
|
||||
///
|
||||
/// It contains the subnodes `row.header` for its main embedded row,
|
||||
/// `list.nested` for the list it can expand, and `image.expander-row-arrow` for
|
||||
/// its arrow.
|
||||
///
|
||||
/// ## Style classes
|
||||
///
|
||||
/// `AdwExpanderRow` can use the [`.`](style-classes.html#property-rows)
|
||||
/// style class to emphasize the row subtitle instead of the row title, which is
|
||||
/// useful for displaying read-only properties.
|
||||
///
|
||||
/// When used together with the `.monospace` style class, only the subtitle
|
||||
/// becomes monospace, not the title or any extra widgets.
|
||||
public struct ExpanderRow: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -58,7 +33,7 @@ public struct ExpanderRow: AdwaitaWidget {
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var subtitle: String?
|
||||
/// The number of lines at the end of which the subtitle label will be
|
||||
/// ellipsized.
|
||||
@ -68,7 +43,7 @@ public struct ExpanderRow: AdwaitaWidget {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var title: String?
|
||||
/// The number of lines at the end of which the title label will be ellipsized.
|
||||
///
|
||||
@ -76,13 +51,13 @@ public struct ExpanderRow: AdwaitaWidget {
|
||||
var titleLines: Int?
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var titleSelectable: Bool?
|
||||
/// Whether to use Pango markup for the title label.
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// Whether an embedded underline in the title indicates a mnemonic.
|
||||
var useUnderline: Bool?
|
||||
@ -253,7 +228,7 @@ if let expanded, newValue != expanded.wrappedValue {
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func subtitle(_ subtitle: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitle = subtitle
|
||||
@ -273,7 +248,7 @@ if let expanded, newValue != expanded.wrappedValue {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func title(_ title: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -291,7 +266,7 @@ if let expanded, newValue != expanded.wrappedValue {
|
||||
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func titleSelectable(_ titleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.titleSelectable = titleSelectable
|
||||
@ -302,7 +277,7 @@ if let expanded, newValue != expanded.wrappedValue {
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Fixed.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// FlowBox.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,7 +10,7 @@ import LevenshteinTransformations
|
||||
|
||||
/// Puts child widgets in a reflowing grid.
|
||||
///
|
||||
/// <picture><source srcset="flow-box-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkFlowBox" src="flow-box.png"></picture>
|
||||
///
|
||||
///
|
||||
/// For instance, with the horizontal orientation, the widgets will be
|
||||
/// arranged from left to right, starting a new row under the previous
|
||||
@ -30,39 +30,13 @@ import LevenshteinTransformations
|
||||
/// The children of a `GtkFlowBox` can be dynamically sorted and filtered.
|
||||
///
|
||||
/// Although a `GtkFlowBox` must have only `GtkFlowBoxChild` children, you
|
||||
/// can add any kind of widget to it via [method@Gtk.FlowBox.insert], and a
|
||||
/// can add any kind of widget to it via `Gtk.FlowBox.insert`, and a
|
||||
/// `GtkFlowBoxChild` widget will automatically be inserted between the box
|
||||
/// and the widget.
|
||||
///
|
||||
/// Also see [class@Gtk.ListBox].
|
||||
/// Also see `Gtk.ListBox`.
|
||||
///
|
||||
/// # Shortcuts and Gestures
|
||||
///
|
||||
/// The following signals have default keybindings:
|
||||
///
|
||||
/// - [signal@Gtk.FlowBox::move-cursor]
|
||||
/// - [signal@Gtk.FlowBox::select-all]
|
||||
/// - [signal@Gtk.FlowBox::toggle-cursor-child]
|
||||
/// - [signal@Gtk.FlowBox::unselect-all]
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// flowbox
|
||||
/// ├── flowboxchild
|
||||
/// │ ╰── <child>├── flowboxchild
|
||||
/// │ ╰── <child>┊
|
||||
/// ╰── [rubberband]
|
||||
/// ```
|
||||
///
|
||||
/// `GtkFlowBox` uses a single CSS node with name flowbox. `GtkFlowBoxChild`
|
||||
/// uses a single CSS node with name flowboxchild. For rubberband selection,
|
||||
/// a subnode with name rubberband is used.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkFlowBox` uses the [enum@Gtk.AccessibleRole.grid] role, and `GtkFlowBoxChild`
|
||||
/// uses the [enum@Gtk.AccessibleRole.grid_cell] role.
|
||||
public struct FlowBox<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -128,8 +102,8 @@ public struct FlowBox<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
var selectAll: (() -> Void)?
|
||||
/// Emitted when the set of selected children changes.
|
||||
///
|
||||
/// Use [method@Gtk.FlowBox.selected_foreach] or
|
||||
/// [method@Gtk.FlowBox.get_selected_children] to obtain the
|
||||
/// Use `Gtk.FlowBox.selected_foreach` or
|
||||
/// `Gtk.FlowBox.get_selected_children` to obtain the
|
||||
/// selected children.
|
||||
var selectedChildrenChanged: (() -> Void)?
|
||||
/// Emitted to toggle the selection of the child that has the focus.
|
||||
@ -380,8 +354,8 @@ public struct FlowBox<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
|
||||
/// Emitted when the set of selected children changes.
|
||||
///
|
||||
/// Use [method@Gtk.FlowBox.selected_foreach] or
|
||||
/// [method@Gtk.FlowBox.get_selected_children] to obtain the
|
||||
/// Use `Gtk.FlowBox.selected_foreach` or
|
||||
/// `Gtk.FlowBox.get_selected_children` to obtain the
|
||||
/// selected children.
|
||||
public func selectedChildrenChanged(_ selectedChildrenChanged: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// HeaderBar.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,95 +10,13 @@ import LevenshteinTransformations
|
||||
|
||||
/// A title bar widget.
|
||||
///
|
||||
/// <picture><source srcset="header-bar-dark.png" media="(prefers-color-scheme: dark)"><img src="header-bar.png" alt="header-bar"></picture>
|
||||
///
|
||||
/// `AdwHeaderBar` is similar to [class@Gtk.HeaderBar], but provides additional
|
||||
///
|
||||
/// `AdwHeaderBar` is similar to `Gtk.HeaderBar`, but provides additional
|
||||
/// features compared to it. Refer to `GtkHeaderBar` for details. It is typically
|
||||
/// used as a top bar within [class@ToolbarView].
|
||||
/// used as a top bar within `ToolbarView`.
|
||||
///
|
||||
/// ## Dialog Integration
|
||||
///
|
||||
/// When placed inside an [class@Dialog], `AdwHeaderBar` will display the dialog
|
||||
/// title instead of window title. It will also adjust the decoration layout to
|
||||
/// ensure it always has a close button and nothing else. Set
|
||||
/// [property@HeaderBar:show-start-title-buttons] and
|
||||
/// [property@HeaderBar:show-end-title-buttons] to `FALSE` to remove it if it's
|
||||
/// unwanted.
|
||||
///
|
||||
/// ## Navigation View Integration
|
||||
///
|
||||
/// When placed inside an [class@NavigationPage], `AdwHeaderBar` will display the
|
||||
/// page title instead of window title.
|
||||
///
|
||||
/// When used together with [class@NavigationView] or [class@NavigationSplitView],
|
||||
/// it will also display a back button that can be used to go back to the previous
|
||||
/// page. The button also has a context menu, allowing to pop multiple pages at
|
||||
/// once, potentially across multiple navigation views.
|
||||
///
|
||||
/// Set [property@HeaderBar:show-back-button] to `FALSE` to disable this behavior
|
||||
/// in rare scenarios where it's unwanted.
|
||||
///
|
||||
/// ## Split View Integration
|
||||
///
|
||||
/// When placed inside [class@NavigationSplitView] or [class@OverlaySplitView],
|
||||
/// `AdwHeaderBar` will automatically hide the title buttons other than at the
|
||||
/// edges of the window.
|
||||
///
|
||||
/// ## Bottom Sheet Integration
|
||||
///
|
||||
/// When played inside [class@BottomSheet], `AdwHeaderBar` will not show the title
|
||||
/// unless [property@BottomSheet:show-drag-handle] is set to `FALSE`, regardless
|
||||
/// of [property@HeaderBar:show-title]. This only applies to the default title,
|
||||
/// titles set with [property@HeaderBar:title-widget] will still be shown.
|
||||
///
|
||||
/// ## Centering Policy
|
||||
///
|
||||
/// [property@HeaderBar:centering-policy] allows to enforce strict centering of
|
||||
/// the title widget. This can be useful for entries inside [class@Clamp].
|
||||
///
|
||||
/// ## Title Buttons
|
||||
///
|
||||
/// Unlike `GtkHeaderBar`, `AdwHeaderBar` allows to toggle title button
|
||||
/// visibility for each side individually, using the
|
||||
/// [property@HeaderBar:show-start-title-buttons] and
|
||||
/// [property@HeaderBar:show-end-title-buttons] properties.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// headerbar
|
||||
/// ╰── windowhandle
|
||||
/// ╰── box
|
||||
/// ├── widget
|
||||
/// │ ╰── box.start
|
||||
/// │ ├── windowcontrols.start
|
||||
/// │ ├── widget
|
||||
/// │ │ ╰── [button.back]
|
||||
/// │ ╰── [other children]
|
||||
/// ├── widget
|
||||
/// │ ╰── [Title Widget]
|
||||
/// ╰── widget
|
||||
/// ╰── box.end
|
||||
/// ├── [other children]
|
||||
/// ╰── windowcontrols.end
|
||||
/// ```
|
||||
///
|
||||
/// `AdwHeaderBar`'s CSS node is called `headerbar`. It contains a `windowhandle`
|
||||
/// subnode, which contains a `box` subnode, which contains three `widget`
|
||||
/// subnodes at the start, center and end of the header bar. The start and end
|
||||
/// subnodes contain a `box` subnode with the `.start` and `.end` style classes
|
||||
/// respectively, and the center node contains a node that represents the title.
|
||||
///
|
||||
/// Each of the boxes contains a `windowcontrols` subnode, see
|
||||
/// [class@Gtk.WindowControls] for details, as well as other children.
|
||||
///
|
||||
/// When [property@HeaderBar:show-back-button] is `TRUE`, the start box also
|
||||
/// contains a node with the name `widget` that contains a node with the name
|
||||
/// `button` and `.back` style class.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwHeaderBar` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
|
||||
public struct HeaderBar: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -109,7 +27,7 @@ public struct HeaderBar: AdwaitaWidget {
|
||||
/// The decoration layout for buttons.
|
||||
///
|
||||
/// If this property is not set, the
|
||||
/// [property@Gtk.Settings:gtk-decoration-layout] setting is used.
|
||||
/// ``gtkDecorationLayout(_:)`` setting is used.
|
||||
///
|
||||
/// The format of the string is button names, separated by commas. A colon
|
||||
/// separates the buttons that should appear at the start from those at the
|
||||
@ -122,23 +40,23 @@ public struct HeaderBar: AdwaitaWidget {
|
||||
/// Whether the header bar can show the back button.
|
||||
///
|
||||
/// The back button will never be shown unless the header bar is placed inside an
|
||||
/// [class@NavigationView]. Usually, there is no reason to set this to `FALSE`.
|
||||
/// `NavigationView`. Usually, there is no reason to set this to `false`.
|
||||
var showBackButton: Bool?
|
||||
/// Whether to show title buttons at the end of the header bar.
|
||||
///
|
||||
/// See [property@HeaderBar:show-start-title-buttons] for the other side.
|
||||
/// See ``showStartTitleButtons(_:)`` for the other side.
|
||||
///
|
||||
/// Which buttons are actually shown and where is determined by the
|
||||
/// [property@HeaderBar:decoration-layout] property, and by the state of the
|
||||
/// ``decorationLayout(_:)`` property, and by the state of the
|
||||
/// window (e.g. a close button will not be shown if the window can't be
|
||||
/// closed).
|
||||
var showEndTitleButtons: Bool?
|
||||
/// Whether to show title buttons at the start of the header bar.
|
||||
///
|
||||
/// See [property@HeaderBar:show-end-title-buttons] for the other side.
|
||||
/// See ``showEndTitleButtons(_:)`` for the other side.
|
||||
///
|
||||
/// Which buttons are actually shown and where is determined by the
|
||||
/// [property@HeaderBar:decoration-layout] property, and by the state of the
|
||||
/// ``decorationLayout(_:)`` property, and by the state of the
|
||||
/// window (e.g. a close button will not be shown if the window can't be
|
||||
/// closed).
|
||||
var showStartTitleButtons: Bool?
|
||||
@ -149,7 +67,7 @@ public struct HeaderBar: AdwaitaWidget {
|
||||
/// When set to `NULL`, the header bar will display the title of the window it
|
||||
/// is contained in.
|
||||
///
|
||||
/// To use a different title, use [class@WindowTitle]:
|
||||
/// To use a different title, use `WindowTitle`:
|
||||
///
|
||||
/// ```xml
|
||||
/// <object class="AdwHeaderBar"><property name="title-widget"><object class="AdwWindowTitle"><property name="title" translatable="yes">Title</property></object></property></object>
|
||||
@ -261,7 +179,7 @@ public struct HeaderBar: AdwaitaWidget {
|
||||
/// The decoration layout for buttons.
|
||||
///
|
||||
/// If this property is not set, the
|
||||
/// [property@Gtk.Settings:gtk-decoration-layout] setting is used.
|
||||
/// ``gtkDecorationLayout(_:)`` setting is used.
|
||||
///
|
||||
/// The format of the string is button names, separated by commas. A colon
|
||||
/// separates the buttons that should appear at the start from those at the
|
||||
@ -279,7 +197,7 @@ public struct HeaderBar: AdwaitaWidget {
|
||||
/// Whether the header bar can show the back button.
|
||||
///
|
||||
/// The back button will never be shown unless the header bar is placed inside an
|
||||
/// [class@NavigationView]. Usually, there is no reason to set this to `FALSE`.
|
||||
/// `NavigationView`. Usually, there is no reason to set this to `false`.
|
||||
public func showBackButton(_ showBackButton: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.showBackButton = showBackButton
|
||||
@ -288,10 +206,10 @@ public struct HeaderBar: AdwaitaWidget {
|
||||
|
||||
/// Whether to show title buttons at the end of the header bar.
|
||||
///
|
||||
/// See [property@HeaderBar:show-start-title-buttons] for the other side.
|
||||
/// See ``showStartTitleButtons(_:)`` for the other side.
|
||||
///
|
||||
/// Which buttons are actually shown and where is determined by the
|
||||
/// [property@HeaderBar:decoration-layout] property, and by the state of the
|
||||
/// ``decorationLayout(_:)`` property, and by the state of the
|
||||
/// window (e.g. a close button will not be shown if the window can't be
|
||||
/// closed).
|
||||
public func showEndTitleButtons(_ showEndTitleButtons: Bool? = true) -> Self {
|
||||
@ -302,10 +220,10 @@ public struct HeaderBar: AdwaitaWidget {
|
||||
|
||||
/// Whether to show title buttons at the start of the header bar.
|
||||
///
|
||||
/// See [property@HeaderBar:show-end-title-buttons] for the other side.
|
||||
/// See ``showEndTitleButtons(_:)`` for the other side.
|
||||
///
|
||||
/// Which buttons are actually shown and where is determined by the
|
||||
/// [property@HeaderBar:decoration-layout] property, and by the state of the
|
||||
/// ``decorationLayout(_:)`` property, and by the state of the
|
||||
/// window (e.g. a close button will not be shown if the window can't be
|
||||
/// closed).
|
||||
public func showStartTitleButtons(_ showStartTitleButtons: Bool? = true) -> Self {
|
||||
@ -326,7 +244,7 @@ public struct HeaderBar: AdwaitaWidget {
|
||||
/// When set to `NULL`, the header bar will display the title of the window it
|
||||
/// is contained in.
|
||||
///
|
||||
/// To use a different title, use [class@WindowTitle]:
|
||||
/// To use a different title, use `WindowTitle`:
|
||||
///
|
||||
/// ```xml
|
||||
/// <object class="AdwHeaderBar"><property name="title-widget"><object class="AdwWindowTitle"><property name="title" translatable="yes">Title</property></object></property></object>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Image.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,11 +10,11 @@ import LevenshteinTransformations
|
||||
|
||||
/// Displays an image.
|
||||
///
|
||||
/// picture><source srcset="image-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkImage" src="image.png"></picture>
|
||||
///
|
||||
///
|
||||
/// Various kinds of object can be displayed as an image; most typically,
|
||||
/// you would load a `GdkTexture` from a file, using the convenience function
|
||||
/// [ctor@Gtk.Image.new_from_file], for instance:
|
||||
/// `Gtk.Image.new_from_file`, for instance:
|
||||
///
|
||||
/// ```c
|
||||
/// GtkWidget *image = gtk_image_new_from_file ("myfile.png");
|
||||
@ -23,30 +23,22 @@ import LevenshteinTransformations
|
||||
/// If the file isn’t loaded successfully, the image will contain a
|
||||
/// “broken image” icon similar to that used in many web browsers.
|
||||
///
|
||||
/// If you want to handle errors in loading the file yourself,
|
||||
/// for example by displaying an error message, then load the image with
|
||||
/// [ctor@Gdk.Texture.new_from_file], then create the `GtkImage` with
|
||||
/// [ctor@Gtk.Image.new_from_paintable].
|
||||
/// If you want to handle errors in loading the file yourself, for example
|
||||
/// by displaying an error message, then load the image with an image
|
||||
/// loading framework such as libglycin, then create the `GtkImage` with
|
||||
/// `Gtk.Image.new_from_paintable`.
|
||||
///
|
||||
/// Sometimes an application will want to avoid depending on external data
|
||||
/// files, such as image files. See the documentation of `GResource` inside
|
||||
/// GIO, for details. In this case, [property@Gtk.Image:resource],
|
||||
/// [ctor@Gtk.Image.new_from_resource], and [method@Gtk.Image.set_from_resource]
|
||||
/// GIO, for details. In this case, ``resource(_:)``,
|
||||
/// `Gtk.Image.new_from_resource`, and `Gtk.Image.set_from_resource`
|
||||
/// should be used.
|
||||
///
|
||||
/// `GtkImage` displays its image as an icon, with a size that is determined
|
||||
/// by the application. See [class@Gtk.Picture] if you want to show an image
|
||||
/// by the application. See `Gtk.Picture` if you want to show an image
|
||||
/// at is actual size.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `GtkImage` has a single CSS node with the name `image`. The style classes
|
||||
/// `.normal-icons` or `.large-icons` may appear, depending on the
|
||||
/// [property@Gtk.Image:icon-size] property.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `GtkImage` uses the [enum@Gtk.AccessibleRole.img] role.
|
||||
public struct Image: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -65,7 +57,7 @@ public struct Image: AdwaitaWidget {
|
||||
/// The size in pixels to display icons at.
|
||||
///
|
||||
/// If set to a value != -1, this property overrides the
|
||||
/// [property@Gtk.Image:icon-size] property for images of type
|
||||
/// ``iconSize(_:)`` property for images of type
|
||||
/// `GTK_IMAGE_ICON_NAME`.
|
||||
var pixelSize: Int?
|
||||
/// A path to a resource file to display.
|
||||
@ -146,7 +138,7 @@ public struct Image: AdwaitaWidget {
|
||||
/// The size in pixels to display icons at.
|
||||
///
|
||||
/// If set to a value != -1, this property overrides the
|
||||
/// [property@Gtk.Image:icon-size] property for images of type
|
||||
/// ``iconSize(_:)`` property for images of type
|
||||
/// `GTK_IMAGE_ICON_NAME`.
|
||||
public func pixelSize(_ pixelSize: Int?) -> Self {
|
||||
var newSelf = self
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Label.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,212 +10,11 @@ import LevenshteinTransformations
|
||||
|
||||
/// Displays a small amount of text.
|
||||
///
|
||||
/// Most labels are used to label another widget (such as an [class@Entry]).
|
||||
/// Most labels are used to label another widget (such as an `Entry`).
|
||||
///
|
||||
/// <picture><source srcset="label-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkLabel" src="label.png"></picture>
|
||||
///
|
||||
/// ## Shortcuts and Gestures
|
||||
///
|
||||
/// `GtkLabel` supports the following keyboard shortcuts, when the cursor is
|
||||
/// visible:
|
||||
///
|
||||
/// - <kbd>Shift</kbd>+<kbd>F10</kbd> or <kbd>Menu</kbd> opens the context menu.
|
||||
/// - <kbd>Ctrl</kbd>+<kbd>A</kbd> or <kbd>Ctrl</kbd>+<kbd>/</kbd>
|
||||
/// selects all.
|
||||
/// - <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> or
|
||||
/// <kbd>Ctrl</kbd>+<kbd>\</kbd> unselects all.
|
||||
///
|
||||
/// Additionally, the following signals have default keybindings:
|
||||
///
|
||||
/// - [signal@Gtk.Label::activate-current-link]
|
||||
/// - [signal@Gtk.Label::copy-clipboard]
|
||||
/// - [signal@Gtk.Label::move-cursor]
|
||||
///
|
||||
/// ## Actions
|
||||
///
|
||||
/// `GtkLabel` defines a set of built-in actions:
|
||||
///
|
||||
/// - `clipboard.copy` copies the text to the clipboard.
|
||||
/// - `clipboard.cut` doesn't do anything, since text in labels can't be deleted.
|
||||
/// - `clipboard.paste` doesn't do anything, since text in labels can't be
|
||||
/// edited.
|
||||
/// - `link.open` opens the link, when activated on a link inside the label.
|
||||
/// - `link.copy` copies the link to the clipboard, when activated on a link
|
||||
/// inside the label.
|
||||
/// - `menu.popup` opens the context menu.
|
||||
/// - `selection.delete` doesn't do anything, since text in labels can't be
|
||||
/// deleted.
|
||||
/// - `selection.select-all` selects all of the text, if the label allows
|
||||
/// selection.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// label
|
||||
/// ├── [selection]
|
||||
/// ├── [link]
|
||||
/// ┊
|
||||
/// ╰── [link]
|
||||
/// ```
|
||||
///
|
||||
/// `GtkLabel` has a single CSS node with the name label. A wide variety
|
||||
/// of style classes may be applied to labels, such as .title, .subtitle,
|
||||
/// .dim-label, etc. In the `GtkShortcutsWindow`, labels are used with the
|
||||
/// .keycap style class.
|
||||
///
|
||||
/// If the label has a selection, it gets a subnode with name selection.
|
||||
///
|
||||
/// If the label has links, there is one subnode per link. These subnodes
|
||||
/// carry the link or visited state depending on whether they have been
|
||||
/// visited. In this case, label node also gets a .link style class.
|
||||
///
|
||||
/// ## GtkLabel as GtkBuildable
|
||||
///
|
||||
/// The GtkLabel implementation of the GtkBuildable interface supports a
|
||||
/// custom `<attributes>` element, which supports any number of `<attribute>`
|
||||
/// elements. The `<attribute>` element has attributes named “name“, “value“,
|
||||
/// “start“ and “end“ and allows you to specify [struct@Pango.Attribute]
|
||||
/// values for this label.
|
||||
///
|
||||
/// An example of a UI definition fragment specifying Pango attributes:
|
||||
///
|
||||
/// ```xml
|
||||
/// <object class="GtkLabel"><attributes><attribute name="weight" value="PANGO_WEIGHT_BOLD"/><attribute name="background" value="red" start="5" end="10"/></attributes></object>
|
||||
/// ```
|
||||
///
|
||||
/// The start and end attributes specify the range of characters to which the
|
||||
/// Pango attribute applies. If start and end are not specified, the attribute is
|
||||
/// applied to the whole text. Note that specifying ranges does not make much
|
||||
/// sense with translatable attributes. Use markup embedded in the translatable
|
||||
/// content instead.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `GtkLabel` uses the [enum@Gtk.AccessibleRole.label] role.
|
||||
///
|
||||
/// ## Mnemonics
|
||||
///
|
||||
/// Labels may contain “mnemonics”. Mnemonics are underlined characters in the
|
||||
/// label, used for keyboard navigation. Mnemonics are created by providing a
|
||||
/// string with an underscore before the mnemonic character, such as `"_File"`,
|
||||
/// to the functions [ctor@Gtk.Label.new_with_mnemonic] or
|
||||
/// [method@Gtk.Label.set_text_with_mnemonic].
|
||||
///
|
||||
/// Mnemonics automatically activate any activatable widget the label is
|
||||
/// inside, such as a [class@Gtk.Button]; if the label is not inside the
|
||||
/// mnemonic’s target widget, you have to tell the label about the target
|
||||
/// using [method@Gtk.Label.set_mnemonic_widget].
|
||||
///
|
||||
/// Here’s a simple example where the label is inside a button:
|
||||
///
|
||||
/// ```c
|
||||
/// // Pressing Alt+H will activate this button
|
||||
/// GtkWidget *button = gtk_button_new ();
|
||||
/// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello");
|
||||
/// gtk_button_set_child (GTK_BUTTON (button), label);
|
||||
/// ```
|
||||
///
|
||||
/// There’s a convenience function to create buttons with a mnemonic label
|
||||
/// already inside:
|
||||
///
|
||||
/// ```c
|
||||
/// // Pressing Alt+H will activate this button
|
||||
/// GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello");
|
||||
/// ```
|
||||
///
|
||||
/// To create a mnemonic for a widget alongside the label, such as a
|
||||
/// [class@Gtk.Entry], you have to point the label at the entry with
|
||||
/// [method@Gtk.Label.set_mnemonic_widget]:
|
||||
///
|
||||
/// ```c
|
||||
/// // Pressing Alt+H will focus the entry
|
||||
/// GtkWidget *entry = gtk_entry_new ();
|
||||
/// GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello");
|
||||
/// gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
|
||||
/// ```
|
||||
///
|
||||
/// ## Markup (styled text)
|
||||
///
|
||||
/// To make it easy to format text in a label (changing colors, fonts, etc.),
|
||||
/// label text can be provided in a simple markup format:
|
||||
///
|
||||
/// Here’s how to create a label with a small font:
|
||||
/// ```c
|
||||
/// GtkWidget *label = gtk_label_new (NULL);
|
||||
/// gtk_label_set_markup (GTK_LABEL (label), "<small>Small text</small>");
|
||||
/// ```
|
||||
///
|
||||
/// (See the Pango manual for complete documentation] of available
|
||||
/// tags, [func@Pango.parse_markup])
|
||||
///
|
||||
/// The markup passed to [method@Gtk.Label.set_markup] must be valid XML; for example,
|
||||
/// literal `<`, `>` and `&` characters must be escaped as `<`, `>`, and `&`.
|
||||
/// If you pass text obtained from the user, file, or a network to
|
||||
/// [method@Gtk.Label.set_markup], you’ll want to escape it with
|
||||
/// [func@GLib.markup_escape_text] or [func@GLib.markup_printf_escaped].
|
||||
///
|
||||
/// Markup strings are just a convenient way to set the [struct@Pango.AttrList]
|
||||
/// on a label; [method@Gtk.Label.set_attributes] may be a simpler way to set
|
||||
/// attributes in some cases. Be careful though; [struct@Pango.AttrList] tends
|
||||
/// to cause internationalization problems, unless you’re applying attributes
|
||||
/// to the entire string (i.e. unless you set the range of each attribute
|
||||
/// to [0, `G_MAXINT`)). The reason is that specifying the `start_index` and
|
||||
/// `end_index` for a [struct@Pango.Attribute] requires knowledge of the exact
|
||||
/// string being displayed, so translations will cause problems.
|
||||
///
|
||||
/// ## Selectable labels
|
||||
///
|
||||
/// Labels can be made selectable with [method@Gtk.Label.set_selectable].
|
||||
/// Selectable labels allow the user to copy the label contents to the
|
||||
/// clipboard. Only labels that contain useful-to-copy information — such
|
||||
/// as error messages — should be made selectable.
|
||||
///
|
||||
/// ## Text layout
|
||||
///
|
||||
/// A label can contain any number of paragraphs, but will have
|
||||
/// performance problems if it contains more than a small number.
|
||||
/// Paragraphs are separated by newlines or other paragraph separators
|
||||
/// understood by Pango.
|
||||
///
|
||||
/// Labels can automatically wrap text if you call [method@Gtk.Label.set_wrap].
|
||||
///
|
||||
/// [method@Gtk.Label.set_justify] sets how the lines in a label align
|
||||
/// with one another. If you want to set how the label as a whole aligns
|
||||
/// in its available space, see the [property@Gtk.Widget:halign] and
|
||||
/// [property@Gtk.Widget:valign] properties.
|
||||
///
|
||||
/// The [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
|
||||
/// properties can be used to control the size allocation of ellipsized or
|
||||
/// wrapped labels. For ellipsizing labels, if either is specified (and less
|
||||
/// than the actual text size), it is used as the minimum width, and the actual
|
||||
/// text size is used as the natural width of the label. For wrapping labels,
|
||||
/// width-chars is used as the minimum width, if specified, and max-width-chars
|
||||
/// is used as the natural width. Even if max-width-chars specified, wrapping
|
||||
/// labels will be rewrapped to use all of the available width.
|
||||
///
|
||||
/// ## Links
|
||||
///
|
||||
/// GTK supports markup for clickable hyperlinks in addition to regular Pango
|
||||
/// markup. The markup for links is borrowed from HTML, using the `<a>` tag
|
||||
/// with “href“, “title“ and “class“ attributes. GTK renders links similar to
|
||||
/// the way they appear in web browsers, with colored, underlined text. The
|
||||
/// “title“ attribute is displayed as a tooltip on the link. The “class“
|
||||
/// attribute is used as style class on the CSS node for the link.
|
||||
///
|
||||
/// An example of inline links looks like this:
|
||||
///
|
||||
/// ```c
|
||||
/// const char *text =
|
||||
/// "Go to the "
|
||||
/// "<a href=\"https://www.gtk.org\" title=\"<i>Our</i> website\">"
|
||||
/// "GTK website</a> for more...";
|
||||
/// GtkWidget *label = gtk_label_new (NULL);
|
||||
/// gtk_label_set_markup (GTK_LABEL (label), text);
|
||||
/// ```
|
||||
///
|
||||
/// It is possible to implement custom handling for links and their tooltips
|
||||
/// with the [signal@Gtk.Label::activate-link] signal and the
|
||||
/// [method@Gtk.Label.get_current_uri] function.
|
||||
public struct Label: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -229,15 +28,15 @@ public struct Label: AdwaitaWidget {
|
||||
var accessibleRole: String?
|
||||
/// The contents of the label.
|
||||
///
|
||||
/// If the string contains Pango markup (see [func@Pango.parse_markup]),
|
||||
/// you will have to set the [property@Gtk.Label:use-markup] property to
|
||||
/// If the string contains Pango markup (see `Pango.parse_markup`),
|
||||
/// you will have to set the ``useMarkup(_:)`` property to
|
||||
/// true in order for the label to display the markup attributes. See also
|
||||
/// [method@Gtk.Label.set_markup] for a convenience function that sets both
|
||||
/// this property and the [property@Gtk.Label:use-markup] property at the
|
||||
/// `Gtk.Label.set_markup` for a convenience function that sets both
|
||||
/// this property and the ``useMarkup(_:)`` property at the
|
||||
/// same time.
|
||||
///
|
||||
/// If the string contains underlines acting as mnemonics, you will have to
|
||||
/// set the [property@Gtk.Label:use-underline] property to true in order
|
||||
/// set the ``useUnderline(_:)`` property to true in order
|
||||
/// for the label to display them.
|
||||
var label: String
|
||||
/// The number of lines to which an ellipsized, wrapping label
|
||||
@ -245,8 +44,8 @@ public struct Label: AdwaitaWidget {
|
||||
/// from ellipsizing before this many lines are displayed, and limits the
|
||||
/// height request of the label to this many lines.
|
||||
///
|
||||
/// ::: warning
|
||||
/// Setting this property has unintuitive and unfortunate consequences
|
||||
/// > [!WARNING]
|
||||
/// > Setting this property has unintuitive and unfortunate consequences
|
||||
/// for the minimum _width_ of the label. Specifically, if the height
|
||||
/// of the label is such that it fits a smaller number of lines than
|
||||
/// the value of this property, the label can not be ellipsized at all,
|
||||
@ -260,9 +59,7 @@ public struct Label: AdwaitaWidget {
|
||||
///
|
||||
/// If this property is set to -1, the width will be calculated automatically.
|
||||
///
|
||||
/// See the section on [text layout](class.Label.html#text-layout) for details
|
||||
/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
|
||||
/// determine the width of ellipsized and wrapped labels.
|
||||
/// See the section on [text layout](class.Label.html
|
||||
var maxWidthChars: Int?
|
||||
/// The mnemonic accelerator key for the label.
|
||||
var mnemonicKeyval: UInt?
|
||||
@ -279,7 +76,7 @@ public struct Label: AdwaitaWidget {
|
||||
var singleLineMode: Bool?
|
||||
/// True if the text of the label includes Pango markup.
|
||||
///
|
||||
/// See [func@Pango.parse_markup].
|
||||
/// See `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// True if the text of the label indicates a mnemonic with an `_`
|
||||
/// before the mnemonic character.
|
||||
@ -288,20 +85,18 @@ public struct Label: AdwaitaWidget {
|
||||
///
|
||||
/// If this property is set to -1, the width will be calculated automatically.
|
||||
///
|
||||
/// See the section on [text layout](class.Label.html#text-layout) for details
|
||||
/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
|
||||
/// determine the width of ellipsized and wrapped labels.
|
||||
/// See the section on [text layout](class.Label.html
|
||||
var widthChars: Int?
|
||||
/// True if the label text will wrap if it gets too wide.
|
||||
var wrap: Bool?
|
||||
/// The horizontal alignment of the label text inside its size allocation.
|
||||
///
|
||||
/// Compare this to [property@Gtk.Widget:halign], which determines how the
|
||||
/// Compare this to ``halign(_:)``, which determines how the
|
||||
/// labels size allocation is positioned in the space available for the label.
|
||||
var xalign: Float?
|
||||
/// The vertical alignment of the label text inside its size allocation.
|
||||
///
|
||||
/// Compare this to [property@Gtk.Widget:valign], which determines how the
|
||||
/// Compare this to ``valign(_:)``, which determines how the
|
||||
/// labels size allocation is positioned in the space available for the label.
|
||||
var yalign: Float?
|
||||
/// Gets emitted to copy the selection to the clipboard.
|
||||
@ -408,15 +203,15 @@ public struct Label: AdwaitaWidget {
|
||||
|
||||
/// The contents of the label.
|
||||
///
|
||||
/// If the string contains Pango markup (see [func@Pango.parse_markup]),
|
||||
/// you will have to set the [property@Gtk.Label:use-markup] property to
|
||||
/// If the string contains Pango markup (see `Pango.parse_markup`),
|
||||
/// you will have to set the ``useMarkup(_:)`` property to
|
||||
/// true in order for the label to display the markup attributes. See also
|
||||
/// [method@Gtk.Label.set_markup] for a convenience function that sets both
|
||||
/// this property and the [property@Gtk.Label:use-markup] property at the
|
||||
/// `Gtk.Label.set_markup` for a convenience function that sets both
|
||||
/// this property and the ``useMarkup(_:)`` property at the
|
||||
/// same time.
|
||||
///
|
||||
/// If the string contains underlines acting as mnemonics, you will have to
|
||||
/// set the [property@Gtk.Label:use-underline] property to true in order
|
||||
/// set the ``useUnderline(_:)`` property to true in order
|
||||
/// for the label to display them.
|
||||
public func label(_ label: String) -> Self {
|
||||
var newSelf = self
|
||||
@ -429,8 +224,8 @@ public struct Label: AdwaitaWidget {
|
||||
/// from ellipsizing before this many lines are displayed, and limits the
|
||||
/// height request of the label to this many lines.
|
||||
///
|
||||
/// ::: warning
|
||||
/// Setting this property has unintuitive and unfortunate consequences
|
||||
/// > [!WARNING]
|
||||
/// > Setting this property has unintuitive and unfortunate consequences
|
||||
/// for the minimum _width_ of the label. Specifically, if the height
|
||||
/// of the label is such that it fits a smaller number of lines than
|
||||
/// the value of this property, the label can not be ellipsized at all,
|
||||
@ -449,9 +244,7 @@ public struct Label: AdwaitaWidget {
|
||||
///
|
||||
/// If this property is set to -1, the width will be calculated automatically.
|
||||
///
|
||||
/// See the section on [text layout](class.Label.html#text-layout) for details
|
||||
/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
|
||||
/// determine the width of ellipsized and wrapped labels.
|
||||
/// See the section on [text layout](class.Label.html
|
||||
public func maxWidthChars(_ maxWidthChars: Int?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.maxWidthChars = maxWidthChars
|
||||
@ -493,7 +286,7 @@ public struct Label: AdwaitaWidget {
|
||||
|
||||
/// True if the text of the label includes Pango markup.
|
||||
///
|
||||
/// See [func@Pango.parse_markup].
|
||||
/// See `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
@ -512,9 +305,7 @@ public struct Label: AdwaitaWidget {
|
||||
///
|
||||
/// If this property is set to -1, the width will be calculated automatically.
|
||||
///
|
||||
/// See the section on [text layout](class.Label.html#text-layout) for details
|
||||
/// of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
|
||||
/// determine the width of ellipsized and wrapped labels.
|
||||
/// See the section on [text layout](class.Label.html
|
||||
public func widthChars(_ widthChars: Int?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.widthChars = widthChars
|
||||
@ -530,7 +321,7 @@ public struct Label: AdwaitaWidget {
|
||||
|
||||
/// The horizontal alignment of the label text inside its size allocation.
|
||||
///
|
||||
/// Compare this to [property@Gtk.Widget:halign], which determines how the
|
||||
/// Compare this to ``halign(_:)``, which determines how the
|
||||
/// labels size allocation is positioned in the space available for the label.
|
||||
public func xalign(_ xalign: Float?) -> Self {
|
||||
var newSelf = self
|
||||
@ -540,7 +331,7 @@ public struct Label: AdwaitaWidget {
|
||||
|
||||
/// The vertical alignment of the label text inside its size allocation.
|
||||
///
|
||||
/// Compare this to [property@Gtk.Widget:valign], which determines how the
|
||||
/// Compare this to ``valign(_:)``, which determines how the
|
||||
/// labels size allocation is positioned in the space available for the label.
|
||||
public func yalign(_ yalign: Float?) -> Self {
|
||||
var newSelf = self
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// LevelBar.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -13,10 +13,10 @@ import LevenshteinTransformations
|
||||
/// Typical use cases are displaying the strength of a password, or
|
||||
/// showing the charge level of a battery.
|
||||
///
|
||||
/// <picture><source srcset="levelbar-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkLevelBar" src="levelbar.png"></picture>
|
||||
///
|
||||
/// Use [method@Gtk.LevelBar.set_value] to set the current value, and
|
||||
/// [method@Gtk.LevelBar.add_offset_value] to set the value offsets at which
|
||||
///
|
||||
/// Use `Gtk.LevelBar.set_value` to set the current value, and
|
||||
/// `Gtk.LevelBar.add_offset_value` to set the value offsets at which
|
||||
/// the bar will be considered in a different state. GTK will add a few
|
||||
/// offsets by default on the level bar: %GTK_LEVEL_BAR_OFFSET_LOW,
|
||||
/// %GTK_LEVEL_BAR_OFFSET_HIGH and %GTK_LEVEL_BAR_OFFSET_FULL, with
|
||||
@ -26,85 +26,7 @@ import LevenshteinTransformations
|
||||
/// when changing the minimum or maximum value. GTK will simply clamp
|
||||
/// them to the new range.
|
||||
///
|
||||
/// ## Adding a custom offset on the bar
|
||||
///
|
||||
/// ```c
|
||||
/// static GtkWidget *
|
||||
/// create_level_bar (void)
|
||||
/// {
|
||||
/// GtkWidget *widget;
|
||||
/// GtkLevelBar *bar;
|
||||
///
|
||||
/// widget = gtk_level_bar_new ();
|
||||
/// bar = GTK_LEVEL_BAR (widget);
|
||||
///
|
||||
/// // This changes the value of the default low offset
|
||||
///
|
||||
/// gtk_level_bar_add_offset_value (bar,
|
||||
/// GTK_LEVEL_BAR_OFFSET_LOW,
|
||||
/// 0.10);
|
||||
///
|
||||
/// // This adds a new offset to the bar; the application will
|
||||
/// // be able to change its color CSS like this:
|
||||
/// //
|
||||
/// // levelbar block.my-offset {
|
||||
/// // background-color: magenta;
|
||||
/// // border-style: solid;
|
||||
/// // border-color: black;
|
||||
/// // border-width: 1px;
|
||||
/// // }
|
||||
///
|
||||
/// gtk_level_bar_add_offset_value (bar, "my-offset", 0.60);
|
||||
///
|
||||
/// return widget;
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// The default interval of values is between zero and one, but it’s possible
|
||||
/// to modify the interval using [method@Gtk.LevelBar.set_min_value] and
|
||||
/// [method@Gtk.LevelBar.set_max_value]. The value will be always drawn in
|
||||
/// proportion to the admissible interval, i.e. a value of 15 with a specified
|
||||
/// interval between 10 and 20 is equivalent to a value of 0.5 with an interval
|
||||
/// between 0 and 1. When %GTK_LEVEL_BAR_MODE_DISCRETE is used, the bar level
|
||||
/// is rendered as a finite number of separated blocks instead of a single one.
|
||||
/// The number of blocks that will be rendered is equal to the number of units
|
||||
/// specified by the admissible interval.
|
||||
///
|
||||
/// For instance, to build a bar rendered with five blocks, it’s sufficient to
|
||||
/// set the minimum value to 0 and the maximum value to 5 after changing the
|
||||
/// indicator mode to discrete.
|
||||
///
|
||||
/// # GtkLevelBar as GtkBuildable
|
||||
///
|
||||
/// The `GtkLevelBar` implementation of the `GtkBuildable` interface supports a
|
||||
/// custom `<offsets>` element, which can contain any number of `<offset>` elements,
|
||||
/// each of which must have "name" and "value" attributes.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// levelbar[.discrete]
|
||||
/// ╰── trough
|
||||
/// ├── block.filled.level-name
|
||||
/// ┊
|
||||
/// ├── block.empty
|
||||
/// ┊
|
||||
/// ```
|
||||
///
|
||||
/// `GtkLevelBar` has a main CSS node with name levelbar and one of the style
|
||||
/// classes .discrete or .continuous and a subnode with name trough. Below the
|
||||
/// trough node are a number of nodes with name block and style class .filled
|
||||
/// or .empty. In continuous mode, there is exactly one node of each, in discrete
|
||||
/// mode, the number of filled and unfilled nodes corresponds to blocks that are
|
||||
/// drawn. The block.filled nodes also get a style class .level-name corresponding
|
||||
/// to the level for the current value.
|
||||
///
|
||||
/// In horizontal orientation, the nodes are always arranged from left to right,
|
||||
/// regardless of text direction.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkLevelBar` uses the [enum@Gtk.AccessibleRole.meter] role.
|
||||
public struct LevelBar: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -129,7 +51,7 @@ public struct LevelBar: AdwaitaWidget {
|
||||
var value: Double?
|
||||
/// Emitted when an offset specified on the bar changes value.
|
||||
///
|
||||
/// This typically is the result of a [method@Gtk.LevelBar.add_offset_value]
|
||||
/// This typically is the result of a `Gtk.LevelBar.add_offset_value`
|
||||
/// call.
|
||||
///
|
||||
/// The signal supports detailed connections; you can connect to the
|
||||
@ -236,7 +158,7 @@ public struct LevelBar: AdwaitaWidget {
|
||||
|
||||
/// Emitted when an offset specified on the bar changes value.
|
||||
///
|
||||
/// This typically is the result of a [method@Gtk.LevelBar.add_offset_value]
|
||||
/// This typically is the result of a `Gtk.LevelBar.add_offset_value`
|
||||
/// call.
|
||||
///
|
||||
/// The signal supports detailed connections; you can connect to the
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// LinkButton.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,43 +10,23 @@ import LevenshteinTransformations
|
||||
|
||||
/// A button with a hyperlink.
|
||||
///
|
||||
/// <picture><source srcset="link-button-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkLinkButton" src="link-button.png"></picture>
|
||||
///
|
||||
///
|
||||
/// It is useful to show quick links to resources.
|
||||
///
|
||||
/// A link button is created by calling either [ctor@Gtk.LinkButton.new] or
|
||||
/// [ctor@Gtk.LinkButton.new_with_label]. If using the former, the URI you
|
||||
/// A link button is created by calling either `Gtk.LinkButton.new` or
|
||||
/// `Gtk.LinkButton.new_with_label`. If using the former, the URI you
|
||||
/// pass to the constructor is used as a label for the widget.
|
||||
///
|
||||
/// The URI bound to a `GtkLinkButton` can be set specifically using
|
||||
/// [method@Gtk.LinkButton.set_uri].
|
||||
/// `Gtk.LinkButton.set_uri`.
|
||||
///
|
||||
/// By default, `GtkLinkButton` calls [method@Gtk.FileLauncher.launch] when the button
|
||||
/// By default, `GtkLinkButton` calls `Gtk.FileLauncher.launch` when the button
|
||||
/// is clicked. This behaviour can be overridden by connecting to the
|
||||
/// [signal@Gtk.LinkButton::activate-link] signal and returning %TRUE from
|
||||
/// `Gtk.LinkButton::activate-link` signal and returning `true` from
|
||||
/// the signal handler.
|
||||
///
|
||||
/// # Shortcuts and Gestures
|
||||
///
|
||||
/// `GtkLinkButton` supports the following keyboard shortcuts:
|
||||
///
|
||||
/// - <kbd>Shift</kbd>+<kbd>F10</kbd> or <kbd>Menu</kbd> opens the context menu.
|
||||
///
|
||||
/// # Actions
|
||||
///
|
||||
/// `GtkLinkButton` defines a set of built-in actions:
|
||||
///
|
||||
/// - `clipboard.copy` copies the url to the clipboard.
|
||||
/// - `menu.popup` opens the context menu.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// `GtkLinkButton` has a single CSS node with name button. To differentiate
|
||||
/// it from a plain `GtkButton`, it gets the .link style class.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkLinkButton` uses the [enum@Gtk.AccessibleRole.link] role.
|
||||
public struct LinkButton: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -88,7 +68,7 @@ public struct LinkButton: AdwaitaWidget {
|
||||
/// Emitted to animate press then release.
|
||||
///
|
||||
/// This is an action signal. Applications should never connect
|
||||
/// to this signal, but use the [signal@Gtk.Button::clicked] signal.
|
||||
/// to this signal, but use the `Gtk.Button::clicked` signal.
|
||||
///
|
||||
/// The default bindings for this signal are all forms of the
|
||||
/// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
@ -262,7 +242,7 @@ public struct LinkButton: AdwaitaWidget {
|
||||
/// Emitted to animate press then release.
|
||||
///
|
||||
/// This is an action signal. Applications should never connect
|
||||
/// to this signal, but use the [signal@Gtk.Button::clicked] signal.
|
||||
/// to this signal, but use the `Gtk.Button::clicked` signal.
|
||||
///
|
||||
/// The default bindings for this signal are all forms of the
|
||||
/// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// ListBox.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,7 +10,7 @@ import LevenshteinTransformations
|
||||
|
||||
/// Shows a vertical list.
|
||||
///
|
||||
/// <picture><source srcset="list-box-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkListBox" src="list-box.png"></picture>
|
||||
///
|
||||
///
|
||||
/// A `GtkListBox` only contains `GtkListBoxRow` children. These rows can
|
||||
/// by dynamically sorted and filtered, and headers can be added dynamically
|
||||
@ -23,55 +23,17 @@ import LevenshteinTransformations
|
||||
/// button in it).
|
||||
///
|
||||
/// Although a `GtkListBox` must have only `GtkListBoxRow` children, you can
|
||||
/// add any kind of widget to it via [method@Gtk.ListBox.prepend],
|
||||
/// [method@Gtk.ListBox.append] and [method@Gtk.ListBox.insert] and a
|
||||
/// add any kind of widget to it via `Gtk.ListBox.prepend`,
|
||||
/// `Gtk.ListBox.append` and `Gtk.ListBox.insert` and a
|
||||
/// `GtkListBoxRow` widget will automatically be inserted between the list
|
||||
/// and the widget.
|
||||
///
|
||||
/// `GtkListBoxRows` can be marked as activatable or selectable. If a row is
|
||||
/// activatable, [signal@Gtk.ListBox::row-activated] will be emitted for it when
|
||||
/// activatable, `Gtk.ListBox::row-activated` will be emitted for it when
|
||||
/// the user tries to activate it. If it is selectable, the row will be marked
|
||||
/// as selected when the user tries to select it.
|
||||
///
|
||||
/// # GtkListBox as GtkBuildable
|
||||
///
|
||||
/// The `GtkListBox` implementation of the `GtkBuildable` interface supports
|
||||
/// setting a child as the placeholder by specifying “placeholder” as the “type”
|
||||
/// attribute of a `<child>` element. See [method@Gtk.ListBox.set_placeholder]
|
||||
/// for info.
|
||||
///
|
||||
/// # Shortcuts and Gestures
|
||||
///
|
||||
/// The following signals have default keybindings:
|
||||
///
|
||||
/// - [signal@Gtk.ListBox::move-cursor]
|
||||
/// - [signal@Gtk.ListBox::select-all]
|
||||
/// - [signal@Gtk.ListBox::toggle-cursor-row]
|
||||
/// - [signal@Gtk.ListBox::unselect-all]
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// list[.separators][.rich-list][.navigation-sidebar][.boxed-list]
|
||||
/// ╰── row[.activatable]
|
||||
/// ```
|
||||
///
|
||||
/// `GtkListBox` uses a single CSS node named list. It may carry the .separators
|
||||
/// style class, when the [property@Gtk.ListBox:show-separators] property is set.
|
||||
/// Each `GtkListBoxRow` uses a single CSS node named row. The row nodes get the
|
||||
/// .activatable style class added when appropriate.
|
||||
///
|
||||
/// It may also carry the .boxed-list style class. In this case, the list will be
|
||||
/// automatically surrounded by a frame and have separators.
|
||||
///
|
||||
/// The main list node may also carry style classes to select
|
||||
/// the style of [list presentation](section-list-widget.html#list-styles):
|
||||
/// .rich-list, .navigation-sidebar or .data-table.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkListBox` uses the [enum@Gtk.AccessibleRole.list] role and `GtkListBoxRow` uses
|
||||
/// the [enum@Gtk.AccessibleRole.list_item] role.
|
||||
public struct ListBox<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -111,7 +73,7 @@ public struct ListBox<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
///
|
||||
/// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not
|
||||
/// give you the full picture of selection changes, and you should use
|
||||
/// the [signal@Gtk.ListBox::selected-rows-changed] signal instead.
|
||||
/// the `Gtk.ListBox::selected-rows-changed` signal instead.
|
||||
var rowSelected: (() -> Void)?
|
||||
/// Emitted to select all children of the box, if the selection
|
||||
/// mode permits it.
|
||||
@ -311,7 +273,7 @@ public struct ListBox<Element>: AdwaitaWidget where Element: Identifiable {
|
||||
///
|
||||
/// When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not
|
||||
/// give you the full picture of selection changes, and you should use
|
||||
/// the [signal@Gtk.ListBox::selected-rows-changed] signal instead.
|
||||
/// the `Gtk.ListBox::selected-rows-changed` signal instead.
|
||||
public func rowSelected(_ rowSelected: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.rowSelected = rowSelected
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Menu.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,22 +10,22 @@ import LevenshteinTransformations
|
||||
|
||||
/// Displays a popup when clicked.
|
||||
///
|
||||
/// <picture><source srcset="menu-button-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkMenuButton" src="menu-button.png"></picture>
|
||||
///
|
||||
///
|
||||
/// This popup can be provided either as a `GtkPopover` or as an abstract
|
||||
/// `GMenuModel`.
|
||||
///
|
||||
/// The `GtkMenuButton` widget can show either an icon (set with the
|
||||
/// [property@Gtk.MenuButton:icon-name] property) or a label (set with the
|
||||
/// [property@Gtk.MenuButton:label] property). If neither is explicitly set,
|
||||
/// a [class@Gtk.Image] is automatically created, using an arrow image oriented
|
||||
/// according to [property@Gtk.MenuButton:direction] or the generic
|
||||
/// ``iconName(_:)`` property) or a label (set with the
|
||||
/// ``label(_:)`` property). If neither is explicitly set,
|
||||
/// a `Gtk.Image` is automatically created, using an arrow image oriented
|
||||
/// according to ``direction(_:)`` or the generic
|
||||
/// “open-menu-symbolic” icon if the direction is not set.
|
||||
///
|
||||
/// The positioning of the popup is determined by the
|
||||
/// [property@Gtk.MenuButton:direction] property of the menu button.
|
||||
/// ``direction(_:)`` property of the menu button.
|
||||
///
|
||||
/// For menus, the [property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
|
||||
/// For menus, the ``halign(_:)`` and ``valign(_:)``
|
||||
/// properties of the menu are also taken into account. For example, when the
|
||||
/// direction is %GTK_ARROW_DOWN and the horizontal alignment is %GTK_ALIGN_START,
|
||||
/// the menu will be positioned below the button, with the starting edge
|
||||
@ -41,34 +41,7 @@ import LevenshteinTransformations
|
||||
/// | **left** |  |  |  |
|
||||
/// | **right** |  |  |  |
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// menubutton
|
||||
/// ╰── button.toggle
|
||||
/// ╰── <content>╰── [arrow]
|
||||
/// ```
|
||||
///
|
||||
/// `GtkMenuButton` has a single CSS node with name `menubutton`
|
||||
/// which contains a `button` node with a `.toggle` style class.
|
||||
///
|
||||
/// If the button contains an icon, it will have the `.image-button` style class,
|
||||
/// if it contains text, it will have `.text-button` style class. If an arrow is
|
||||
/// visible in addition to an icon, text or a custom child, it will also have
|
||||
/// `.arrow-button` style class.
|
||||
///
|
||||
/// Inside the toggle button content, there is an `arrow` node for
|
||||
/// the indicator, which will carry one of the `.none`, `.up`, `.down`,
|
||||
/// `.left` or `.right` style classes to indicate the direction that
|
||||
/// the menu will appear in. The CSS is expected to provide a suitable
|
||||
/// image for each of these cases using the `-gtk-icon-source` property.
|
||||
///
|
||||
/// Optionally, the `menubutton` node can carry the `.circular` style class
|
||||
/// to request a round appearance.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkMenuButton` uses the [enum@Gtk.AccessibleRole.button] role.
|
||||
public struct Menu: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -97,8 +70,8 @@ public struct Menu: AdwaitaWidget {
|
||||
var label: String?
|
||||
/// The `GMenuModel` from which the popup will be created.
|
||||
///
|
||||
/// See [method@Gtk.MenuButton.set_menu_model] for the interaction
|
||||
/// with the [property@Gtk.MenuButton:popover] property.
|
||||
/// See `Gtk.MenuButton.set_menu_model` for the interaction
|
||||
/// with the ``popover(_:)`` property.
|
||||
var menuModel: (() -> Body)?
|
||||
/// Whether the menu button acts as a primary menu.
|
||||
///
|
||||
@ -264,8 +237,8 @@ if let active, newValue != active.wrappedValue {
|
||||
|
||||
/// The `GMenuModel` from which the popup will be created.
|
||||
///
|
||||
/// See [method@Gtk.MenuButton.set_menu_model] for the interaction
|
||||
/// with the [property@Gtk.MenuButton:popover] property.
|
||||
/// See `Gtk.MenuButton.set_menu_model` for the interaction
|
||||
/// with the ``popover(_:)`` property.
|
||||
public func menuModel(@ViewBuilder _ menuModel: @escaping (() -> Body)) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.menuModel = menuModel
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// NavigationView.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,114 +10,33 @@ import LevenshteinTransformations
|
||||
|
||||
/// A page-based navigation container.
|
||||
///
|
||||
/// <picture><source srcset="navigation-view-dark.png" media="(prefers-color-scheme: dark)"><img src="navigation-view.png" alt="navigation-view"></picture>
|
||||
///
|
||||
///
|
||||
/// `AdwNavigationView` presents one child at a time, similar to
|
||||
/// [class@Gtk.Stack].
|
||||
/// `Gtk.Stack`.
|
||||
///
|
||||
/// `AdwNavigationView` can only contain [class@NavigationPage] children.
|
||||
/// `AdwNavigationView` can only contain `NavigationPage` children.
|
||||
///
|
||||
/// It maintains a navigation stack that can be controlled with
|
||||
/// [method@NavigationView.push] and [method@NavigationView.pop]. The whole
|
||||
/// navigation stack can also be replaced using [method@NavigationView.replace].
|
||||
/// `NavigationView.push` and `NavigationView.pop`. The whole
|
||||
/// navigation stack can also be replaced using `NavigationView.replace`.
|
||||
///
|
||||
/// `AdwNavigationView` allows to manage pages statically or dynamically.
|
||||
///
|
||||
/// Static pages can be added using the [method@NavigationView.add] method. The
|
||||
/// Static pages can be added using the `NavigationView.add` method. The
|
||||
/// `AdwNavigationView` will keep a reference to these pages, but they aren't
|
||||
/// accessible to the user until [method@NavigationView.push] is called (except
|
||||
/// accessible to the user until `NavigationView.push` is called (except
|
||||
/// for the first page, which is pushed automatically). Use the
|
||||
/// [method@NavigationView.remove] method to remove them. This is useful for
|
||||
/// `NavigationView.remove` method to remove them. This is useful for
|
||||
/// applications that have a small number of unique pages and just need
|
||||
/// navigation between them.
|
||||
///
|
||||
/// Dynamic pages are automatically destroyed once they are popped off the
|
||||
/// navigation stack. To add a page like this, push it using the
|
||||
/// [method@NavigationView.push] method without calling
|
||||
/// [method@NavigationView.add] first.
|
||||
/// `NavigationView.push` method without calling
|
||||
/// `NavigationView.add` first.
|
||||
///
|
||||
/// ## Tags
|
||||
///
|
||||
/// Static pages, as well as any pages in the navigation stack, can be accessed
|
||||
/// by their [property@NavigationPage:tag]. For example,
|
||||
/// [method@NavigationView.push_by_tag] can be used to push a static page that's
|
||||
/// not in the navigation stack without having to keep a reference to it manually.
|
||||
///
|
||||
/// ## Header Bar Integration
|
||||
///
|
||||
/// When used inside `AdwNavigationView`, [class@HeaderBar] will automatically
|
||||
/// display a back button that can be used to go back to the previous page when
|
||||
/// possible. The button also has a context menu, allowing to pop multiple pages
|
||||
/// at once, potentially across multiple navigation views.
|
||||
///
|
||||
/// Set [property@HeaderBar:show-back-button] to `FALSE` to disable this behavior
|
||||
/// in rare scenarios where it's unwanted.
|
||||
///
|
||||
/// `AdwHeaderBar` will also display the title of the `AdwNavigationPage` it's
|
||||
/// placed into, so most applications shouldn't need to customize it at all.
|
||||
///
|
||||
/// ## Shortcuts and Gestures
|
||||
///
|
||||
/// `AdwNavigationView` supports the following shortcuts for going to the
|
||||
/// previous page:
|
||||
///
|
||||
/// - <kbd>Escape</kbd> (unless [property@NavigationView:pop-on-escape] is set to
|
||||
/// `FALSE`)
|
||||
/// - <kbd>Alt</kbd>+<kbd>←</kbd>
|
||||
/// - Back mouse button
|
||||
///
|
||||
/// Additionally, it supports interactive gestures:
|
||||
///
|
||||
/// - One-finger swipe towards the right on touchscreens
|
||||
/// - Scrolling towards the right on touchpads (usually two-finger swipe)
|
||||
///
|
||||
/// These gestures have transitions enabled regardless of the
|
||||
/// [property@NavigationView:animate-transitions] value.
|
||||
///
|
||||
/// Applications can also enable shortcuts for pushing another page onto the
|
||||
/// navigation stack via connecting to the [signal@NavigationView::get-next-page]
|
||||
/// signal, in that case the following shortcuts are supported:
|
||||
///
|
||||
/// - <kbd>Alt</kbd>+<kbd>→</kbd>
|
||||
/// - Forward mouse button
|
||||
/// - Swipe/scrolling towards the left
|
||||
///
|
||||
/// For right-to-left locales, the gestures and shortcuts are reversed.
|
||||
///
|
||||
/// [property@NavigationPage:can-pop] can be used to disable them, along with the
|
||||
/// header bar back buttons.
|
||||
///
|
||||
/// ## Actions
|
||||
///
|
||||
/// `AdwNavigationView` defines actions for controlling the navigation stack.
|
||||
/// actions for controlling the navigation stack:
|
||||
///
|
||||
/// - `navigation.push` takes a string parameter specifying the tag of the page to
|
||||
/// push, and is equivalent to calling [method@NavigationView.push_by_tag].
|
||||
///
|
||||
/// - `navigation.pop` doesn't take any parameters and pops the current page from
|
||||
/// the navigation stack, equivalent to calling [method@NavigationView.pop].
|
||||
///
|
||||
/// ## `AdwNavigationView` as `GtkBuildable`
|
||||
///
|
||||
/// `AdwNavigationView` allows to add pages as children, equivalent to using the
|
||||
/// [method@NavigationView.add] method.
|
||||
///
|
||||
/// Example of an `AdwNavigationView` UI definition:
|
||||
///
|
||||
/// ```xml
|
||||
/// <object class="AdwNavigationView"><child><object class="AdwNavigationPage"><property name="title" translatable="yes">Page 1</property><property name="child"><object class="AdwToolbarView"><child type="top"><object class="AdwHeaderBar"/></child><property name="content"><object class="GtkButton"><property name="label" translatable="yes">Open Page 2</property><property name="halign">center</property><property name="valign">center</property><property name="action-name">navigation.push</property><property name="action-target">'page-2'</property><style><class name="pill"/></style></object></property></object></property></object></child><child><object class="AdwNavigationPage"><property name="title" translatable="yes">Page 2</property><property name="tag">page-2</property><property name="child"><object class="AdwToolbarView"><child type="top"><object class="AdwHeaderBar"/></child><property name="content"><!-- ... --></property></object></property></object></child></object>
|
||||
/// ```
|
||||
///
|
||||
/// <picture><source srcset="navigation-view-example-dark.png" media="(prefers-color-scheme: dark)"><img src="navigation-view-example.png" alt="navigation-view-example"></picture>
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwNavigationView` has a single CSS node with the name `navigation-view`.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwNavigationView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
|
||||
public struct NavigationView: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -162,23 +81,23 @@ public struct NavigationView: AdwaitaWidget {
|
||||
/// not make any irreversible changes in the handler, such as removing the page
|
||||
/// from a forward stack.
|
||||
///
|
||||
/// Instead, it should be done in the [signal@NavigationView::pushed] handler.
|
||||
/// Instead, it should be done in the `NavigationView::pushed` handler.
|
||||
var getNextPage: (() -> Void)?
|
||||
/// Emitted after @page has been popped from the navigation stack.
|
||||
///
|
||||
/// See [method@NavigationView.pop].
|
||||
/// See `NavigationView.pop`.
|
||||
///
|
||||
/// When using [method@NavigationView.pop_to_page] or
|
||||
/// [method@NavigationView.pop_to_tag], this signal is emitted for each of the
|
||||
/// When using `NavigationView.pop_to_page` or
|
||||
/// `NavigationView.pop_to_tag`, this signal is emitted for each of the
|
||||
/// popped pages.
|
||||
var popped: (() -> Void)?
|
||||
/// Emitted after a page has been pushed to the navigation stack.
|
||||
///
|
||||
/// See [method@NavigationView.push].
|
||||
/// See `NavigationView.push`.
|
||||
var pushed: (() -> Void)?
|
||||
/// Emitted after the navigation stack has been replaced.
|
||||
///
|
||||
/// See [method@NavigationView.replace].
|
||||
/// See `NavigationView.replace`.
|
||||
var replaced: (() -> Void)?
|
||||
|
||||
/// Initialize `NavigationView`.
|
||||
@ -315,7 +234,7 @@ public struct NavigationView: AdwaitaWidget {
|
||||
/// not make any irreversible changes in the handler, such as removing the page
|
||||
/// from a forward stack.
|
||||
///
|
||||
/// Instead, it should be done in the [signal@NavigationView::pushed] handler.
|
||||
/// Instead, it should be done in the `NavigationView::pushed` handler.
|
||||
public func getNextPage(_ getNextPage: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.getNextPage = getNextPage
|
||||
@ -324,10 +243,10 @@ public struct NavigationView: AdwaitaWidget {
|
||||
|
||||
/// Emitted after @page has been popped from the navigation stack.
|
||||
///
|
||||
/// See [method@NavigationView.pop].
|
||||
/// See `NavigationView.pop`.
|
||||
///
|
||||
/// When using [method@NavigationView.pop_to_page] or
|
||||
/// [method@NavigationView.pop_to_tag], this signal is emitted for each of the
|
||||
/// When using `NavigationView.pop_to_page` or
|
||||
/// `NavigationView.pop_to_tag`, this signal is emitted for each of the
|
||||
/// popped pages.
|
||||
public func popped(_ popped: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
@ -337,7 +256,7 @@ public struct NavigationView: AdwaitaWidget {
|
||||
|
||||
/// Emitted after a page has been pushed to the navigation stack.
|
||||
///
|
||||
/// See [method@NavigationView.push].
|
||||
/// See `NavigationView.push`.
|
||||
public func pushed(_ pushed: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.pushed = pushed
|
||||
@ -346,7 +265,7 @@ public struct NavigationView: AdwaitaWidget {
|
||||
|
||||
/// Emitted after the navigation stack has been replaced.
|
||||
///
|
||||
/// See [method@NavigationView.replace].
|
||||
/// See `NavigationView.replace`.
|
||||
public func replaced(_ replaced: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.replaced = replaced
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Overlay.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,10 +10,10 @@ import LevenshteinTransformations
|
||||
|
||||
/// Places “overlay” widgets on top of a single main child.
|
||||
///
|
||||
/// <picture><source srcset="overlay-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkOverlay" src="overlay.png"></picture>
|
||||
///
|
||||
///
|
||||
/// The position of each overlay widget is determined by its
|
||||
/// [property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
|
||||
/// ``halign(_:)`` and ``valign(_:)``
|
||||
/// properties. E.g. a widget with both alignments set to %GTK_ALIGN_START
|
||||
/// will be placed at the top left corner of the `GtkOverlay` container,
|
||||
/// whereas an overlay with halign set to %GTK_ALIGN_CENTER and valign set
|
||||
@ -22,23 +22,13 @@ import LevenshteinTransformations
|
||||
/// properties of the child to non-zero values.
|
||||
///
|
||||
/// More complicated placement of overlays is possible by connecting
|
||||
/// to the [signal@Gtk.Overlay::get-child-position] signal.
|
||||
/// to the `Gtk.Overlay::get-child-position` signal.
|
||||
///
|
||||
/// An overlay’s minimum and natural sizes are those of its main child.
|
||||
/// The sizes of overlay children are not considered when measuring these
|
||||
/// preferred sizes.
|
||||
///
|
||||
/// # GtkOverlay as GtkBuildable
|
||||
///
|
||||
/// The `GtkOverlay` implementation of the `GtkBuildable` interface
|
||||
/// supports placing a child as an overlay by specifying “overlay” as
|
||||
/// the “type” attribute of a `<child>` element.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// `GtkOverlay` has a single CSS node with the name “overlay”. Overlay children
|
||||
/// whose alignments cause them to be positioned at an edge get the style classes
|
||||
/// “.left”, “.right”, “.top”, and/or “.bottom” according to their position.
|
||||
public struct Overlay: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// OverlaySplitView.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,34 +10,34 @@ import LevenshteinTransformations
|
||||
|
||||
/// A widget presenting sidebar and content side by side or as an overlay.
|
||||
///
|
||||
/// <picture><source srcset="overlay-split-view-dark.png" media="(prefers-color-scheme: dark)"><img src="overlay-split-view.png" alt="overlay-split-view"></picture><picture><source srcset="overlay-split-view-collapsed-dark.png" media="(prefers-color-scheme: dark)"><img src="overlay-split-view-collapsed.png" alt="overlay-split-view-collapsed"></picture>
|
||||
///
|
||||
///
|
||||
/// `AdwOverlaySplitView` has two children: sidebar and content, and displays
|
||||
/// them side by side.
|
||||
///
|
||||
/// When [property@OverlaySplitView:collapsed] is set to `TRUE`, the sidebar is
|
||||
/// When ``collapsed(_:)`` is set to `true`, the sidebar is
|
||||
/// instead shown as an overlay above the content widget.
|
||||
///
|
||||
/// The sidebar can be hidden or shown using the
|
||||
/// [property@OverlaySplitView:show-sidebar] property.
|
||||
/// ``showSidebar(_:)`` property.
|
||||
///
|
||||
/// Sidebar can be displayed before or after the content, this can be controlled
|
||||
/// with the [property@OverlaySplitView:sidebar-position] property.
|
||||
/// with the ``sidebarPosition(_:)`` property.
|
||||
///
|
||||
/// Collapsing the split view automatically hides the sidebar widget, and
|
||||
/// uncollapsing it shows the sidebar. If this behavior is not desired, the
|
||||
/// [property@OverlaySplitView:pin-sidebar] property can be used to override it.
|
||||
/// ``pinSidebar(_:)`` property can be used to override it.
|
||||
///
|
||||
/// `AdwOverlaySplitView` supports an edge swipe gesture for showing the sidebar,
|
||||
/// and a swipe from the sidebar for hiding it. Gestures are only supported on
|
||||
/// touchscreen, but not touchpad. Gestures can be controlled with the
|
||||
/// [property@OverlaySplitView:enable-show-gesture] and
|
||||
/// [property@OverlaySplitView:enable-hide-gesture] properties.
|
||||
/// ``enableShowGesture(_:)`` and
|
||||
/// ``enableHideGesture(_:)`` properties.
|
||||
///
|
||||
/// See also [class@NavigationSplitView].
|
||||
/// See also `NavigationSplitView`.
|
||||
///
|
||||
/// `AdwOverlaySplitView` is typically used together with an [class@Breakpoint]
|
||||
/// setting the `collapsed` property to `TRUE` on small widths, as follows:
|
||||
/// `AdwOverlaySplitView` is typically used together with an `Breakpoint`
|
||||
/// setting the `collapsed` property to `true` on small widths, as follows:
|
||||
///
|
||||
/// ```xml
|
||||
/// <object class="AdwWindow"><property name="default-width">800</property><property name="default-height">800</property><child><object class="AdwBreakpoint"><condition>max-width: 400sp</condition><setter object="split_view" property="collapsed">True</setter></object></child><property name="content"><object class="AdwOverlaySplitView" id="split_view"><property name="sidebar"><!-- ... --></property><property name="content"><!-- ... --></property></object></property></object>
|
||||
@ -47,72 +47,7 @@ import LevenshteinTransformations
|
||||
/// [utility pane](https://developer.gnome.org/hig/patterns/containers/utility-panes.html)
|
||||
/// pattern.
|
||||
///
|
||||
/// ## Sizing
|
||||
///
|
||||
/// When not collapsed, `AdwOverlaySplitView` changes the sidebar width
|
||||
/// depending on its own width.
|
||||
///
|
||||
/// If possible, it tries to allocate a fraction of the total width, controlled
|
||||
/// with the [property@OverlaySplitView:sidebar-width-fraction] property.
|
||||
///
|
||||
/// The sidebar also has minimum and maximum sizes, controlled with the
|
||||
/// [property@OverlaySplitView:min-sidebar-width] and
|
||||
/// [property@OverlaySplitView:max-sidebar-width] properties.
|
||||
///
|
||||
/// The minimum and maximum sizes are using the length unit specified with the
|
||||
/// [property@OverlaySplitView:sidebar-width-unit].
|
||||
///
|
||||
/// By default, sidebar is using 25% of the total width, with 180sp as the
|
||||
/// minimum size and 280sp as the maximum size.
|
||||
///
|
||||
/// When collapsed, the preferred width fraction is ignored and the sidebar uses
|
||||
/// [property@OverlaySplitView:max-sidebar-width] when possible.
|
||||
///
|
||||
/// ## Header Bar Integration
|
||||
///
|
||||
/// When used inside `AdwOverlaySplitView`, [class@HeaderBar] will automatically
|
||||
/// hide the window buttons in the middle.
|
||||
///
|
||||
/// ## `AdwOverlaySplitView` as `GtkBuildable`
|
||||
///
|
||||
/// The `AdwOverlaySplitView` implementation of the [iface@Gtk.Buildable]
|
||||
/// interface supports setting the sidebar widget by specifying “sidebar” as the
|
||||
/// “type” attribute of a `<child>` element, Specifying “content” child type or
|
||||
/// omitting it results in setting the content widget.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwOverlaySplitView` has a single CSS node with the name
|
||||
/// `overlay-split-view`.
|
||||
///
|
||||
/// It contains two nodes with the name `widget`, containing the sidebar and
|
||||
/// content children.
|
||||
///
|
||||
/// When not collapsed, they have the `.sidebar-view` and `.content-view` style
|
||||
/// classes respectively.
|
||||
///
|
||||
/// ```
|
||||
/// overlay-split-view
|
||||
/// ├── widget.sidebar-pane
|
||||
/// │ ╰── [sidebar child]
|
||||
/// ╰── widget.content-pane
|
||||
/// ╰── [content child]
|
||||
/// ```
|
||||
///
|
||||
/// When collapsed, the one containing the sidebar child has the `.background`
|
||||
/// style class and the other one has no style classes.
|
||||
///
|
||||
/// ```
|
||||
/// overlay-split-view
|
||||
/// ├── widget.background
|
||||
/// │ ╰── [sidebar child]
|
||||
/// ╰── widget
|
||||
/// ╰── [content child]
|
||||
/// ```
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwOverlaySplitView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
|
||||
public struct OverlaySplitView: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -138,7 +73,7 @@ public struct OverlaySplitView: AdwaitaWidget {
|
||||
/// The maximum sidebar width.
|
||||
///
|
||||
/// Maximum width is affected by
|
||||
/// [property@OverlaySplitView:sidebar-width-unit].
|
||||
/// ``sidebarWidthUnit(_:)``.
|
||||
///
|
||||
/// The sidebar widget can still be allocated with larger width if its own
|
||||
/// minimum width exceeds it.
|
||||
@ -146,7 +81,7 @@ public struct OverlaySplitView: AdwaitaWidget {
|
||||
/// The minimum sidebar width.
|
||||
///
|
||||
/// Minimum width is affected by
|
||||
/// [property@OverlaySplitView:sidebar-width-unit].
|
||||
/// ``sidebarWidthUnit(_:)``.
|
||||
///
|
||||
/// The sidebar widget can still be allocated with larger width if its own
|
||||
/// minimum width exceeds it.
|
||||
@ -154,7 +89,7 @@ public struct OverlaySplitView: AdwaitaWidget {
|
||||
/// Whether the sidebar widget is pinned.
|
||||
///
|
||||
/// By default, collapsing @self automatically hides the sidebar widget, and
|
||||
/// uncollapsing it shows the sidebar. If set to `TRUE`, sidebar visibility
|
||||
/// uncollapsing it shows the sidebar. If set to `true`, sidebar visibility
|
||||
/// never changes on its own.
|
||||
var pinSidebar: Bool?
|
||||
/// Whether the sidebar widget is shown.
|
||||
@ -164,8 +99,8 @@ public struct OverlaySplitView: AdwaitaWidget {
|
||||
/// The preferred sidebar width as a fraction of the total width.
|
||||
///
|
||||
/// The preferred width is additionally limited by
|
||||
/// [property@OverlaySplitView:min-sidebar-width] and
|
||||
/// [property@OverlaySplitView:max-sidebar-width].
|
||||
/// ``minSidebarWidth(_:)`` and
|
||||
/// ``maxSidebarWidth(_:)``.
|
||||
///
|
||||
/// The sidebar widget can be allocated with larger width if its own minimum
|
||||
/// width exceeds the preferred width.
|
||||
@ -293,7 +228,7 @@ if let showSidebar, newValue != showSidebar.wrappedValue {
|
||||
/// The maximum sidebar width.
|
||||
///
|
||||
/// Maximum width is affected by
|
||||
/// [property@OverlaySplitView:sidebar-width-unit].
|
||||
/// ``sidebarWidthUnit(_:)``.
|
||||
///
|
||||
/// The sidebar widget can still be allocated with larger width if its own
|
||||
/// minimum width exceeds it.
|
||||
@ -306,7 +241,7 @@ if let showSidebar, newValue != showSidebar.wrappedValue {
|
||||
/// The minimum sidebar width.
|
||||
///
|
||||
/// Minimum width is affected by
|
||||
/// [property@OverlaySplitView:sidebar-width-unit].
|
||||
/// ``sidebarWidthUnit(_:)``.
|
||||
///
|
||||
/// The sidebar widget can still be allocated with larger width if its own
|
||||
/// minimum width exceeds it.
|
||||
@ -319,7 +254,7 @@ if let showSidebar, newValue != showSidebar.wrappedValue {
|
||||
/// Whether the sidebar widget is pinned.
|
||||
///
|
||||
/// By default, collapsing @self automatically hides the sidebar widget, and
|
||||
/// uncollapsing it shows the sidebar. If set to `TRUE`, sidebar visibility
|
||||
/// uncollapsing it shows the sidebar. If set to `true`, sidebar visibility
|
||||
/// never changes on its own.
|
||||
public func pinSidebar(_ pinSidebar: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
@ -344,8 +279,8 @@ if let showSidebar, newValue != showSidebar.wrappedValue {
|
||||
/// The preferred sidebar width as a fraction of the total width.
|
||||
///
|
||||
/// The preferred width is additionally limited by
|
||||
/// [property@OverlaySplitView:min-sidebar-width] and
|
||||
/// [property@OverlaySplitView:max-sidebar-width].
|
||||
/// ``minSidebarWidth(_:)`` and
|
||||
/// ``maxSidebarWidth(_:)``.
|
||||
///
|
||||
/// The sidebar widget can be allocated with larger width if its own minimum
|
||||
/// width exceeds the preferred width.
|
||||
|
||||
@ -2,15 +2,15 @@
|
||||
// PasswordEntryRow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// A [class@EntryRow] tailored for entering secrets.
|
||||
/// A `EntryRow` tailored for entering secrets.
|
||||
///
|
||||
///
|
||||
/// <picture><source srcset="password-entry-row-dark.png" media="(prefers-color-scheme: dark)"><img src="password-entry-row.png" alt="password-entry-row"></picture>
|
||||
///
|
||||
/// It does not show its contents in clear text, does not allow to copy it to the
|
||||
/// clipboard, and shows a warning when Caps Lock is engaged. If the underlying
|
||||
@ -20,10 +20,7 @@ import LevenshteinTransformations
|
||||
///
|
||||
/// It offer a way to reveal the contents in clear text.
|
||||
///
|
||||
/// ## CSS Nodes
|
||||
///
|
||||
/// `AdwPasswordEntryRow` has a single CSS node with name `row` that carries
|
||||
/// `.entry` and `.password` style classes.
|
||||
public struct PasswordEntryRow: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -41,9 +38,9 @@ public struct PasswordEntryRow: AdwaitaWidget {
|
||||
var maxLength: Int?
|
||||
/// Whether to show the apply button.
|
||||
///
|
||||
/// When set to `TRUE`, typing text in the entry will reveal an apply button.
|
||||
/// When set to `true`, typing text in the entry will reveal an apply button.
|
||||
/// Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
|
||||
/// emit the [signal@EntryRow::apply] signal.
|
||||
/// emit the `EntryRow::apply` signal.
|
||||
///
|
||||
/// This is useful if changing the entry contents can trigger an expensive
|
||||
/// operation, e.g. network activity, to avoid triggering it after typing every
|
||||
@ -54,23 +51,23 @@ public struct PasswordEntryRow: AdwaitaWidget {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var title: String?
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var titleSelectable: Bool?
|
||||
/// Whether to use Pango markup for the title label.
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// Whether an embedded underline in the title indicates a mnemonic.
|
||||
var useUnderline: Bool?
|
||||
/// Emitted when the apply button is pressed.
|
||||
///
|
||||
/// See [property@EntryRow:show-apply-button].
|
||||
/// See ``showApplyButton(_:)``.
|
||||
var apply: (() -> Void)?
|
||||
/// Emitted when the embedded entry is activated.
|
||||
var entryActivated: (() -> Void)?
|
||||
@ -190,9 +187,9 @@ public struct PasswordEntryRow: AdwaitaWidget {
|
||||
|
||||
/// Whether to show the apply button.
|
||||
///
|
||||
/// When set to `TRUE`, typing text in the entry will reveal an apply button.
|
||||
/// When set to `true`, typing text in the entry will reveal an apply button.
|
||||
/// Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
|
||||
/// emit the [signal@EntryRow::apply] signal.
|
||||
/// emit the `EntryRow::apply` signal.
|
||||
///
|
||||
/// This is useful if changing the entry contents can trigger an expensive
|
||||
/// operation, e.g. network activity, to avoid triggering it after typing every
|
||||
@ -213,7 +210,7 @@ public struct PasswordEntryRow: AdwaitaWidget {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func title(_ title: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -222,7 +219,7 @@ public struct PasswordEntryRow: AdwaitaWidget {
|
||||
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func titleSelectable(_ titleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.titleSelectable = titleSelectable
|
||||
@ -233,7 +230,7 @@ public struct PasswordEntryRow: AdwaitaWidget {
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
@ -249,7 +246,7 @@ public struct PasswordEntryRow: AdwaitaWidget {
|
||||
|
||||
/// Emitted when the apply button is pressed.
|
||||
///
|
||||
/// See [property@EntryRow:show-apply-button].
|
||||
/// See ``showApplyButton(_:)``.
|
||||
public func apply(_ apply: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.apply = apply
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Picture.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,7 +10,7 @@ import LevenshteinTransformations
|
||||
|
||||
/// Displays a `GdkPaintable`.
|
||||
///
|
||||
/// picture><source srcset="picture-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkPicture" src="picture.png"></picture>
|
||||
///
|
||||
///
|
||||
/// Many convenience functions are provided to make pictures simple to use.
|
||||
/// For example, if you want to load an image from a file, and then display
|
||||
@ -24,36 +24,18 @@ import LevenshteinTransformations
|
||||
/// “broken image” icon similar to that used in many web browsers.
|
||||
/// If you want to handle errors in loading the file yourself,
|
||||
/// for example by displaying an error message, then load the image with
|
||||
/// [ctor@Gdk.Texture.new_from_file], then create the `GtkPicture` with
|
||||
/// [ctor@Gtk.Picture.new_for_paintable].
|
||||
/// and image loading framework such as libglycin, then create the `GtkPicture`
|
||||
/// with `Gtk.Picture.new_for_paintable`.
|
||||
///
|
||||
/// Sometimes an application will want to avoid depending on external data
|
||||
/// files, such as image files. See the documentation of `GResource` for details.
|
||||
/// In this case, [ctor@Gtk.Picture.new_for_resource] and
|
||||
/// [method@Gtk.Picture.set_resource] should be used.
|
||||
/// In this case, `Gtk.Picture.new_for_resource` and
|
||||
/// `Gtk.Picture.set_resource` should be used.
|
||||
///
|
||||
/// `GtkPicture` displays an image at its natural size. See [class@Gtk.Image]
|
||||
/// `GtkPicture` displays an image at its natural size. See `Gtk.Image`
|
||||
/// if you want to display a fixed-size image, such as an icon.
|
||||
///
|
||||
/// ## Sizing the paintable
|
||||
///
|
||||
/// You can influence how the paintable is displayed inside the `GtkPicture`
|
||||
/// by changing [property@Gtk.Picture:content-fit]. See [enum@Gtk.ContentFit]
|
||||
/// for details. [property@Gtk.Picture:can-shrink] can be unset to make sure
|
||||
/// that paintables are never made smaller than their ideal size - but
|
||||
/// be careful if you do not know the size of the paintable in use (like
|
||||
/// when displaying user-loaded images). This can easily cause the picture to
|
||||
/// grow larger than the screen. And [property@Gtk.Widget:halign] and
|
||||
/// [property@Gtk.Widget:valign] can be used to make sure the paintable doesn't
|
||||
/// fill all available space but is instead displayed at its original size.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `GtkPicture` has a single CSS node with the name `picture`.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `GtkPicture` uses the [enum@Gtk.AccessibleRole.img] role.
|
||||
public struct Picture: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Popover.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,80 +10,29 @@ import LevenshteinTransformations
|
||||
|
||||
/// Presents a bubble-like popup.
|
||||
///
|
||||
/// <picture><source srcset="popover-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkPopover" src="popover.png"></picture>
|
||||
///
|
||||
///
|
||||
/// It is primarily meant to provide context-dependent information
|
||||
/// or options. Popovers are attached to a parent widget. The parent widget
|
||||
/// must support popover children, as [class@Gtk.MenuButton] and
|
||||
/// [class@Gtk.PopoverMenuBar] do. If you want to make a custom widget that
|
||||
/// has an attached popover, you need to call [method@Gtk.Popover.present]
|
||||
/// must support popover children, as `Gtk.MenuButton` and
|
||||
/// `Gtk.PopoverMenuBar` do. If you want to make a custom widget that
|
||||
/// has an attached popover, you need to call `Gtk.Popover.present`
|
||||
/// in your [vfunc@Gtk.Widget.size_allocate] vfunc, in order to update the
|
||||
/// positioning of the popover.
|
||||
///
|
||||
/// The position of a popover relative to the widget it is attached to
|
||||
/// can also be changed with [method@Gtk.Popover.set_position]. By default,
|
||||
/// can also be changed with `Gtk.Popover.set_position`. By default,
|
||||
/// it points to the whole widget area, but it can be made to point to
|
||||
/// a specific area using [method@Gtk.Popover.set_pointing_to].
|
||||
/// a specific area using `Gtk.Popover.set_pointing_to`.
|
||||
///
|
||||
/// By default, `GtkPopover` performs a grab, in order to ensure input
|
||||
/// events get redirected to it while it is shown, and also so the popover
|
||||
/// is dismissed in the expected situations (clicks outside the popover,
|
||||
/// or the Escape key being pressed). If no such modal behavior is desired
|
||||
/// on a popover, [method@Gtk.Popover.set_autohide] may be called on it to
|
||||
/// on a popover, `Gtk.Popover.set_autohide` may be called on it to
|
||||
/// tweak its behavior.
|
||||
///
|
||||
/// ## GtkPopover as menu replacement
|
||||
///
|
||||
/// `GtkPopover` is often used to replace menus. The best way to do this
|
||||
/// is to use the [class@Gtk.PopoverMenu] subclass which supports being
|
||||
/// populated from a `GMenuModel` with [ctor@Gtk.PopoverMenu.new_from_model].
|
||||
///
|
||||
/// ```xml
|
||||
/// <section><attribute name="display-hint">horizontal-buttons</attribute><item><attribute name="label">Cut</attribute><attribute name="action">app.cut</attribute><attribute name="verb-icon">edit-cut-symbolic</attribute></item><item><attribute name="label">Copy</attribute><attribute name="action">app.copy</attribute><attribute name="verb-icon">edit-copy-symbolic</attribute></item><item><attribute name="label">Paste</attribute><attribute name="action">app.paste</attribute><attribute name="verb-icon">edit-paste-symbolic</attribute></item></section>
|
||||
/// ```
|
||||
///
|
||||
/// # Shortcuts and Gestures
|
||||
///
|
||||
/// `GtkPopover` supports the following keyboard shortcuts:
|
||||
///
|
||||
/// - <kbd>Escape</kbd> closes the popover.
|
||||
/// - <kbd>Alt</kbd> makes the mnemonics visible.
|
||||
///
|
||||
/// The following signals have default keybindings:
|
||||
///
|
||||
/// - [signal@Gtk.Popover::activate-default]
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// popover.background[.menu]
|
||||
/// ├── arrow
|
||||
/// ╰── contents
|
||||
/// ╰── <child>
|
||||
/// ```
|
||||
///
|
||||
/// `GtkPopover` has a main node with name `popover`, an arrow with name `arrow`,
|
||||
/// and another node for the content named `contents`. The `popover` node always
|
||||
/// gets the `.background` style class. It also gets the `.menu` style class
|
||||
/// if the popover is menu-like, e.g. is a [class@Gtk.PopoverMenu].
|
||||
///
|
||||
/// Particular uses of `GtkPopover`, such as touch selection popups or
|
||||
/// magnifiers in `GtkEntry` or `GtkTextView` get style classes like
|
||||
/// `.touch-selection` or `.magnifier` to differentiate from plain popovers.
|
||||
///
|
||||
/// When styling a popover directly, the `popover` node should usually
|
||||
/// not have any background. The visible part of the popover can have
|
||||
/// a shadow. To specify it in CSS, set the box-shadow of the `contents` node.
|
||||
///
|
||||
/// Note that, in order to accomplish appropriate arrow visuals, `GtkPopover`
|
||||
/// uses custom drawing for the `arrow` node. This makes it possible for the
|
||||
/// arrow to change its shape dynamically, but it also limits the possibilities
|
||||
/// of styling it using CSS. In particular, the `arrow` gets drawn over the
|
||||
/// `content` node's border and shadow, so they look like one shape, which
|
||||
/// means that the border width of the `content` node and the `arrow` node should
|
||||
/// be the same. The arrow also does not support any border shape other than
|
||||
/// solid, no border-radius, only one border width (border-bottom-width is
|
||||
/// used) and no box-shadow.
|
||||
public struct Popover: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// PreferencesGroup.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,37 +10,18 @@ import LevenshteinTransformations
|
||||
|
||||
/// A group of preference rows.
|
||||
///
|
||||
/// <picture><source srcset="preferences-group-dark.png" media="(prefers-color-scheme: dark)"><img src="preferences-group.png" alt="preferences-group"></picture>
|
||||
///
|
||||
///
|
||||
/// An `AdwPreferencesGroup` represents a group or tightly related preferences,
|
||||
/// which in turn are represented by [class@PreferencesRow].
|
||||
/// which in turn are represented by `PreferencesRow`.
|
||||
///
|
||||
/// To summarize the role of the preferences it gathers, a group can have both a
|
||||
/// title and a description. The title will be used by [class@PreferencesDialog]
|
||||
/// title and a description. The title will be used by `PreferencesDialog`
|
||||
/// to let the user look for a preference.
|
||||
///
|
||||
/// The [property@PreferencesGroup:separate-rows] property can be used to
|
||||
/// The ``separateRows(_:)`` property can be used to
|
||||
/// separate the rows within the group, same as when using the
|
||||
/// [`.boxed-list-separate`](style-classes.html#boxed-lists-cards) style class
|
||||
/// instead of `.boxed-list`.
|
||||
///
|
||||
/// ## AdwPreferencesGroup as GtkBuildable
|
||||
///
|
||||
/// The `AdwPreferencesGroup` implementation of the [iface@Gtk.Buildable] interface
|
||||
/// supports adding [class@PreferencesRow]s to the list by omitting "type". If "type"
|
||||
/// is omitted and the widget isn't a [class@PreferencesRow] the child is added to
|
||||
/// a box below the list.
|
||||
///
|
||||
/// When the "type" attribute of a child is `header-suffix`, the child
|
||||
/// is set as the suffix on the end of the title and description.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwPreferencesGroup` has a single CSS node with name `preferencesgroup`.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwPreferencesGroup` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
|
||||
/// [`.boxed-list-separate`](style-classes.html
|
||||
public struct PreferencesGroup: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -60,8 +41,7 @@ public struct PreferencesGroup: AdwaitaWidget {
|
||||
/// Whether to separate rows.
|
||||
///
|
||||
/// Equivalent to using the
|
||||
/// [`.boxed-list-separate`](style-classes.html#boxed-lists-cards) style class
|
||||
/// on a [class@Gtk.ListBox] instead of `.boxed-list`.
|
||||
/// [`.boxed-list-separate`](style-classes.html
|
||||
var separateRows: Bool?
|
||||
/// The title for this group of preferences.
|
||||
var title: String?
|
||||
@ -164,8 +144,7 @@ public struct PreferencesGroup: AdwaitaWidget {
|
||||
/// Whether to separate rows.
|
||||
///
|
||||
/// Equivalent to using the
|
||||
/// [`.boxed-list-separate`](style-classes.html#boxed-lists-cards) style class
|
||||
/// on a [class@Gtk.ListBox] instead of `.boxed-list`.
|
||||
/// [`.boxed-list-separate`](style-classes.html
|
||||
public func separateRows(_ separateRows: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.separateRows = separateRows
|
||||
|
||||
@ -2,26 +2,20 @@
|
||||
// PreferencesPage.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// A page from [class@PreferencesDialog].
|
||||
/// A page from `PreferencesDialog`.
|
||||
///
|
||||
///
|
||||
/// <picture><source srcset="preferences-page-dark.png" media="(prefers-color-scheme: dark)"><img src="preferences-page.png" alt="preferences-page"></picture>
|
||||
///
|
||||
/// The `AdwPreferencesPage` widget gathers preferences groups into a single page
|
||||
/// of a preferences window.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwPreferencesPage` has a single CSS node with name `preferencespage`.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwPreferencesPage` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
|
||||
public struct PreferencesPage: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,19 +2,19 @@
|
||||
// PreferencesRow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// A [class@Gtk.ListBoxRow] used to present preferences.
|
||||
/// A `Gtk.ListBoxRow` used to present preferences.
|
||||
///
|
||||
/// The `AdwPreferencesRow` widget has a title that [class@PreferencesDialog]
|
||||
/// The `AdwPreferencesRow` widget has a title that `PreferencesDialog`
|
||||
/// will use to let the user look for a preference. It doesn't present the title
|
||||
/// in any way and lets you present the preference as you please.
|
||||
///
|
||||
/// [class@ActionRow] and its derivatives are convenient to use as preference
|
||||
/// `ActionRow` and its derivatives are convenient to use as preference
|
||||
/// rows as they take care of presenting the preference's title while letting you
|
||||
/// compose the inputs of the preference around it.
|
||||
public struct PreferencesRow: AdwaitaWidget {
|
||||
@ -27,17 +27,17 @@ public struct PreferencesRow: AdwaitaWidget {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var title: String?
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var titleSelectable: Bool?
|
||||
/// Whether to use Pango markup for the title label.
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// Whether an embedded underline in the title indicates a mnemonic.
|
||||
var useUnderline: Bool?
|
||||
@ -97,7 +97,7 @@ public struct PreferencesRow: AdwaitaWidget {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func title(_ title: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -106,7 +106,7 @@ public struct PreferencesRow: AdwaitaWidget {
|
||||
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func titleSelectable(_ titleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.titleSelectable = titleSelectable
|
||||
@ -117,7 +117,7 @@ public struct PreferencesRow: AdwaitaWidget {
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// ProgressBar.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -13,19 +13,19 @@ import LevenshteinTransformations
|
||||
/// `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.
|
||||
/// `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]
|
||||
/// this mode, the application is required to call `Gtk.ProgressBar.pulse`
|
||||
/// periodically to update the progress bar.
|
||||
///
|
||||
/// There is quite a bit of flexibility provided to control the appearance
|
||||
@ -33,26 +33,7 @@ import LevenshteinTransformations
|
||||
/// 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.
|
||||
public struct ProgressBar: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -73,13 +54,13 @@ public struct ProgressBar: AdwaitaWidget {
|
||||
/// Sets whether the progress bar will show a text in addition
|
||||
/// to the bar itself.
|
||||
///
|
||||
/// The shown text is either the value of the [property@Gtk.ProgressBar:text]
|
||||
/// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction]
|
||||
/// The shown text is either the value of the ``text(_:)``
|
||||
/// property or, if that is %NULL, the ``fraction(_:)``
|
||||
/// value, as a percentage.
|
||||
///
|
||||
/// To make a progress bar that is styled and sized suitably for showing 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 %NULL).
|
||||
/// (even if the actual text is blank), set ``showText(_:)``
|
||||
/// to `true` and ``text(_:)`` to the empty string (not %NULL).
|
||||
var showText: Bool?
|
||||
/// Text to be displayed in the progress bar.
|
||||
var text: String?
|
||||
@ -172,13 +153,13 @@ public struct ProgressBar: AdwaitaWidget {
|
||||
/// Sets whether the progress bar will show a text in addition
|
||||
/// to the bar itself.
|
||||
///
|
||||
/// The shown text is either the value of the [property@Gtk.ProgressBar:text]
|
||||
/// property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction]
|
||||
/// The shown text is either the value of the ``text(_:)``
|
||||
/// property or, if that is %NULL, the ``fraction(_:)``
|
||||
/// value, as a percentage.
|
||||
///
|
||||
/// To make a progress bar that is styled and sized suitably for showing 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 %NULL).
|
||||
/// (even if the actual text is blank), set ``showText(_:)``
|
||||
/// to `true` and ``text(_:)`` to the empty string (not %NULL).
|
||||
public func showText(_ showText: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.showText = showText
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// ScrolledWindow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,28 +10,28 @@ import LevenshteinTransformations
|
||||
|
||||
/// Makes its child scrollable.
|
||||
///
|
||||
/// <picture><source srcset="scrolledwindow-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkScrolledWindow" src="scrolledwindow.png"></picture>
|
||||
///
|
||||
///
|
||||
/// It does so using either internally added scrollbars or externally
|
||||
/// associated adjustments, and optionally draws a frame around the child.
|
||||
///
|
||||
/// Widgets with native scrolling support, i.e. those whose classes implement
|
||||
/// the [iface@Gtk.Scrollable] interface, are added directly. For other types
|
||||
/// of widget, the class [class@Gtk.Viewport] acts as an adaptor, giving
|
||||
/// scrollability to other widgets. [method@Gtk.ScrolledWindow.set_child]
|
||||
/// the `Gtk.Scrollable` interface, are added directly. For other types
|
||||
/// of widget, the class `Gtk.Viewport` acts as an adaptor, giving
|
||||
/// scrollability to other widgets. `Gtk.ScrolledWindow.set_child`
|
||||
/// intelligently accounts for whether or not the added child is a `GtkScrollable`.
|
||||
/// If it isn’t, then it wraps the child in a `GtkViewport`. Therefore, you can
|
||||
/// just add any child widget and not worry about the details.
|
||||
///
|
||||
/// If [method@Gtk.ScrolledWindow.set_child] has added a `GtkViewport` for you,
|
||||
/// If `Gtk.ScrolledWindow.set_child` has added a `GtkViewport` for you,
|
||||
/// it will be automatically removed when you unset the child.
|
||||
/// Unless [property@Gtk.ScrolledWindow:hscrollbar-policy] and
|
||||
/// [property@Gtk.ScrolledWindow:vscrollbar-policy] are %GTK_POLICY_NEVER or
|
||||
/// Unless ``hscrollbarPolicy(_:)`` and
|
||||
/// ``vscrollbarPolicy(_:)`` are %GTK_POLICY_NEVER or
|
||||
/// %GTK_POLICY_EXTERNAL, `GtkScrolledWindow` adds internal `GtkScrollbar` widgets
|
||||
/// around its child. The scroll position of the child, and if applicable the
|
||||
/// scrollbars, is controlled by the [property@Gtk.ScrolledWindow:hadjustment]
|
||||
/// and [property@Gtk.ScrolledWindow:vadjustment] that are associated with the
|
||||
/// `GtkScrolledWindow`. See the docs on [class@Gtk.Scrollbar] for the details,
|
||||
/// scrollbars, is controlled by the ``hadjustment(_:)``
|
||||
/// and ``vadjustment(_:)`` that are associated with the
|
||||
/// `GtkScrolledWindow`. See the docs on `Gtk.Scrollbar` for the details,
|
||||
/// but note that the “step_increment” and “page_increment” fields are only
|
||||
/// effective if the policy causes scrollbars to be present.
|
||||
///
|
||||
@ -39,52 +39,7 @@ import LevenshteinTransformations
|
||||
/// doesn’t have exactly the right layout, it’s very possible to set up
|
||||
/// your own scrolling with `GtkScrollbar` and for example a `GtkGrid`.
|
||||
///
|
||||
/// # Touch support
|
||||
///
|
||||
/// `GtkScrolledWindow` has built-in support for touch devices. When a
|
||||
/// touchscreen is used, swiping will move the scrolled window, and will
|
||||
/// expose 'kinetic' behavior. This can be turned off with the
|
||||
/// [property@Gtk.ScrolledWindow:kinetic-scrolling] property if it is undesired.
|
||||
///
|
||||
/// `GtkScrolledWindow` also displays visual 'overshoot' indication when
|
||||
/// the content is pulled beyond the end, and this situation can be
|
||||
/// captured with the [signal@Gtk.ScrolledWindow::edge-overshot] signal.
|
||||
///
|
||||
/// If no mouse device is present, the scrollbars will overlaid as
|
||||
/// narrow, auto-hiding indicators over the content. If traditional
|
||||
/// scrollbars are desired although no mouse is present, this behaviour
|
||||
/// can be turned off with the [property@Gtk.ScrolledWindow:overlay-scrolling]
|
||||
/// property.
|
||||
///
|
||||
/// # Shortcuts and Gestures
|
||||
///
|
||||
/// The following signals have default keybindings:
|
||||
///
|
||||
/// - [signal@Gtk.ScrolledWindow::scroll-child]
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// `GtkScrolledWindow` has a main CSS node with name scrolledwindow.
|
||||
/// It gets a .frame style class added when [property@Gtk.ScrolledWindow:has-frame]
|
||||
/// is %TRUE.
|
||||
///
|
||||
/// It uses subnodes with names overshoot and undershoot to draw the overflow
|
||||
/// and underflow indications. These nodes get the .left, .right, .top or .bottom
|
||||
/// style class added depending on where the indication is drawn.
|
||||
///
|
||||
/// `GtkScrolledWindow` also sets the positional style classes (.left, .right,
|
||||
/// .top, .bottom) and style classes related to overlay scrolling
|
||||
/// (.overlay-indicator, .dragging, .hovering) on its scrollbars.
|
||||
///
|
||||
/// If both scrollbars are visible, the area where they meet is drawn
|
||||
/// with a subnode named junction.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// Until GTK 4.10, `GtkScrolledWindow` used the [enum@Gtk.AccessibleRole.group] role.
|
||||
///
|
||||
/// Starting from GTK 4.12, `GtkScrolledWindow` uses the [enum@Gtk.AccessibleRole.generic]
|
||||
/// role.
|
||||
public struct ScrolledWindow: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -99,14 +54,14 @@ public struct ScrolledWindow: AdwaitaWidget {
|
||||
/// The child widget.
|
||||
///
|
||||
/// When setting this property, if the child widget does not implement
|
||||
/// [iface@Gtk.Scrollable], the scrolled window will add the child to
|
||||
/// a [class@Gtk.Viewport] and then set the viewport as the child.
|
||||
/// `Gtk.Scrollable`, the scrolled window will add the child to
|
||||
/// a `Gtk.Viewport` and then set the viewport as the child.
|
||||
var child: (() -> Body)?
|
||||
/// Whether to draw a frame around the contents.
|
||||
var hasFrame: Bool?
|
||||
/// When the horizontal scrollbar is displayed.
|
||||
///
|
||||
/// Use [method@Gtk.ScrolledWindow.set_policy] to set
|
||||
/// Use `Gtk.ScrolledWindow.set_policy` to set
|
||||
/// this property.
|
||||
var hscrollbarPolicy: ScrollbarVisibility?
|
||||
/// Whether kinetic scrolling is enabled or not.
|
||||
@ -128,7 +83,7 @@ public struct ScrolledWindow: AdwaitaWidget {
|
||||
/// the content, as narrow indicators.
|
||||
///
|
||||
/// Note that overlay scrolling can also be globally disabled, with
|
||||
/// the [property@Gtk.Settings:gtk-overlay-scrolling] setting.
|
||||
/// the ``gtkOverlayScrolling(_:)`` setting.
|
||||
var overlayScrolling: Bool?
|
||||
/// Whether the natural height of the child should be calculated and propagated
|
||||
/// through the scrolled window’s requested natural height.
|
||||
@ -144,7 +99,7 @@ public struct ScrolledWindow: AdwaitaWidget {
|
||||
var propagateNaturalWidth: Bool?
|
||||
/// When the vertical scrollbar is displayed.
|
||||
///
|
||||
/// Use [method@Gtk.ScrolledWindow.set_policy] to set
|
||||
/// Use `Gtk.ScrolledWindow.set_policy` to set
|
||||
/// this property.
|
||||
var vscrollbarPolicy: ScrollbarVisibility?
|
||||
/// Emitted whenever user initiated scrolling makes the scrolled
|
||||
@ -152,7 +107,7 @@ public struct ScrolledWindow: AdwaitaWidget {
|
||||
/// in that orientation.
|
||||
///
|
||||
/// A similar behavior without edge resistance is provided by the
|
||||
/// [signal@Gtk.ScrolledWindow::edge-reached] signal.
|
||||
/// `Gtk.ScrolledWindow::edge-reached` signal.
|
||||
///
|
||||
/// Note: The @pos argument is LTR/RTL aware, so callers should be
|
||||
/// aware too if intending to provide behavior on horizontal edges.
|
||||
@ -162,7 +117,7 @@ public struct ScrolledWindow: AdwaitaWidget {
|
||||
/// adjustment in that orientation.
|
||||
///
|
||||
/// A similar behavior with edge resistance is provided by the
|
||||
/// [signal@Gtk.ScrolledWindow::edge-overshot] signal.
|
||||
/// `Gtk.ScrolledWindow::edge-overshot` signal.
|
||||
///
|
||||
/// Note: The @pos argument is LTR/RTL aware, so callers should be
|
||||
/// aware too if intending to provide behavior on horizontal edges.
|
||||
@ -299,8 +254,8 @@ if hscrollbarPolicy != (storage.previousState as? Self)?.hscrollbarPolicy
|
||||
/// The child widget.
|
||||
///
|
||||
/// When setting this property, if the child widget does not implement
|
||||
/// [iface@Gtk.Scrollable], the scrolled window will add the child to
|
||||
/// a [class@Gtk.Viewport] and then set the viewport as the child.
|
||||
/// `Gtk.Scrollable`, the scrolled window will add the child to
|
||||
/// a `Gtk.Viewport` and then set the viewport as the child.
|
||||
public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.child = child
|
||||
@ -316,7 +271,7 @@ if hscrollbarPolicy != (storage.previousState as? Self)?.hscrollbarPolicy
|
||||
|
||||
/// When the horizontal scrollbar is displayed.
|
||||
///
|
||||
/// Use [method@Gtk.ScrolledWindow.set_policy] to set
|
||||
/// Use `Gtk.ScrolledWindow.set_policy` to set
|
||||
/// this property.
|
||||
public func hscrollbarPolicy(_ hscrollbarPolicy: ScrollbarVisibility?) -> Self {
|
||||
var newSelf = self
|
||||
@ -368,7 +323,7 @@ if hscrollbarPolicy != (storage.previousState as? Self)?.hscrollbarPolicy
|
||||
/// the content, as narrow indicators.
|
||||
///
|
||||
/// Note that overlay scrolling can also be globally disabled, with
|
||||
/// the [property@Gtk.Settings:gtk-overlay-scrolling] setting.
|
||||
/// the ``gtkOverlayScrolling(_:)`` setting.
|
||||
public func overlayScrolling(_ overlayScrolling: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.overlayScrolling = overlayScrolling
|
||||
@ -399,7 +354,7 @@ if hscrollbarPolicy != (storage.previousState as? Self)?.hscrollbarPolicy
|
||||
|
||||
/// When the vertical scrollbar is displayed.
|
||||
///
|
||||
/// Use [method@Gtk.ScrolledWindow.set_policy] to set
|
||||
/// Use `Gtk.ScrolledWindow.set_policy` to set
|
||||
/// this property.
|
||||
public func vscrollbarPolicy(_ vscrollbarPolicy: ScrollbarVisibility?) -> Self {
|
||||
var newSelf = self
|
||||
@ -412,7 +367,7 @@ if hscrollbarPolicy != (storage.previousState as? Self)?.hscrollbarPolicy
|
||||
/// in that orientation.
|
||||
///
|
||||
/// A similar behavior without edge resistance is provided by the
|
||||
/// [signal@Gtk.ScrolledWindow::edge-reached] signal.
|
||||
/// `Gtk.ScrolledWindow::edge-reached` signal.
|
||||
///
|
||||
/// Note: The @pos argument is LTR/RTL aware, so callers should be
|
||||
/// aware too if intending to provide behavior on horizontal edges.
|
||||
@ -427,7 +382,7 @@ if hscrollbarPolicy != (storage.previousState as? Self)?.hscrollbarPolicy
|
||||
/// adjustment in that orientation.
|
||||
///
|
||||
/// A similar behavior with edge resistance is provided by the
|
||||
/// [signal@Gtk.ScrolledWindow::edge-overshot] signal.
|
||||
/// `Gtk.ScrolledWindow::edge-overshot` signal.
|
||||
///
|
||||
/// Note: The @pos argument is LTR/RTL aware, so callers should be
|
||||
/// aware too if intending to provide behavior on horizontal edges.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// SearchBar.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,7 +10,7 @@ import LevenshteinTransformations
|
||||
|
||||
/// Reveals a search entry when search is started.
|
||||
///
|
||||
/// <picture><source srcset="search-bar-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkSearchBar" src="search-bar.png"></picture>
|
||||
///
|
||||
///
|
||||
/// It can also contain additional widgets, such as drop-down menus,
|
||||
/// or buttons. The search bar would appear when a search is started
|
||||
@ -19,45 +19,15 @@ import LevenshteinTransformations
|
||||
///
|
||||
/// For keyboard presses to start a search, the search bar must be told
|
||||
/// of a widget to capture key events from through
|
||||
/// [method@Gtk.SearchBar.set_key_capture_widget]. This widget will
|
||||
/// `Gtk.SearchBar.set_key_capture_widget`. This widget will
|
||||
/// typically be the top-level window, or a parent container of the
|
||||
/// search bar. Common shortcuts such as Ctrl+F should be handled as an
|
||||
/// application action, or through the menu items.
|
||||
///
|
||||
/// You will also need to tell the search bar about which entry you
|
||||
/// are using as your search entry using [method@Gtk.SearchBar.connect_entry].
|
||||
/// are using as your search entry using `Gtk.SearchBar.connect_entry`.
|
||||
///
|
||||
/// ## Creating a search bar
|
||||
///
|
||||
/// The following example shows you how to create a more complex search
|
||||
/// entry.
|
||||
///
|
||||
/// [A simple example](https://gitlab.gnome.org/GNOME/gtk/tree/main/examples/search-bar.c)
|
||||
///
|
||||
/// # Shortcuts and Gestures
|
||||
///
|
||||
/// `GtkSearchBar` supports the following keyboard shortcuts:
|
||||
///
|
||||
/// - <kbd>Escape</kbd> hides the search bar.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// searchbar
|
||||
/// ╰── revealer
|
||||
/// ╰── box
|
||||
/// ├── [child]
|
||||
/// ╰── [button.close]
|
||||
/// ```
|
||||
///
|
||||
/// `GtkSearchBar` has a main CSS node with name searchbar. It has a child
|
||||
/// node with name revealer that contains a node with name box. The box node
|
||||
/// contains both the CSS node of the child widget as well as an optional button
|
||||
/// node which gets the .close style class applied.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkSearchBar` uses the [enum@Gtk.AccessibleRole.search] role.
|
||||
public struct SearchBar: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// SearchEntry.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -13,7 +13,7 @@ import LevenshteinTransformations
|
||||
/// The main API for interacting with a `GtkSearchEntry` as entry
|
||||
/// is the `GtkEditable` interface.
|
||||
///
|
||||
/// <picture><source srcset="search-entry-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkSearchEntry" src="search-entry.png"></picture>
|
||||
///
|
||||
///
|
||||
/// It will show an inactive symbolic “find” icon when the search
|
||||
/// entry is empty, and a symbolic “clear” icon when there is text.
|
||||
@ -22,44 +22,23 @@ import LevenshteinTransformations
|
||||
/// To make filtering appear more reactive, it is a good idea to
|
||||
/// not react to every change in the entry text immediately, but
|
||||
/// only after a short delay. To support this, `GtkSearchEntry`
|
||||
/// emits the [signal@Gtk.SearchEntry::search-changed] signal which
|
||||
/// can be used instead of the [signal@Gtk.Editable::changed] signal.
|
||||
/// emits the `Gtk.SearchEntry::search-changed` signal which
|
||||
/// can be used instead of the `Gtk.Editable::changed` signal.
|
||||
///
|
||||
/// The [signal@Gtk.SearchEntry::previous-match],
|
||||
/// [signal@Gtk.SearchEntry::next-match] and
|
||||
/// [signal@Gtk.SearchEntry::stop-search] signals can be used to
|
||||
/// The `Gtk.SearchEntry::previous-match`,
|
||||
/// `Gtk.SearchEntry::next-match` and
|
||||
/// `Gtk.SearchEntry::stop-search` signals can be used to
|
||||
/// implement moving between search results and ending the search.
|
||||
///
|
||||
/// Often, `GtkSearchEntry` will be fed events by means of being
|
||||
/// placed inside a [class@Gtk.SearchBar]. If that is not the case,
|
||||
/// you can use [method@Gtk.SearchEntry.set_key_capture_widget] to
|
||||
/// placed inside a `Gtk.SearchBar`. If that is not the case,
|
||||
/// you can use `Gtk.SearchEntry.set_key_capture_widget` to
|
||||
/// let it capture key input from another widget.
|
||||
///
|
||||
/// `GtkSearchEntry` provides only minimal API and should be used with
|
||||
/// the [iface@Gtk.Editable] API.
|
||||
/// the `Gtk.Editable` API.
|
||||
///
|
||||
/// ## Shortcuts and Gestures
|
||||
///
|
||||
/// The following signals have default keybindings:
|
||||
///
|
||||
/// - [signal@Gtk.SearchEntry::activate]
|
||||
/// - [signal@Gtk.SearchEntry::next-match]
|
||||
/// - [signal@Gtk.SearchEntry::previous-match]
|
||||
/// - [signal@Gtk.SearchEntry::stop-search]
|
||||
///
|
||||
/// ## CSS Nodes
|
||||
///
|
||||
/// ```
|
||||
/// entry.search
|
||||
/// ╰── text
|
||||
/// ```
|
||||
///
|
||||
/// `GtkSearchEntry` has a single CSS node with name entry that carries
|
||||
/// a `.search` style class, and the text node is a child of that.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `GtkSearchEntry` uses the [enum@Gtk.AccessibleRole.search_box] role.
|
||||
public struct SearchEntry: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -118,7 +97,7 @@ public struct SearchEntry: AdwaitaWidget {
|
||||
/// range of deleted text, or prevent it from being deleted entirely.
|
||||
///
|
||||
/// The @start_pos and @end_pos parameters are interpreted as for
|
||||
/// [method@Gtk.Editable.delete_text].
|
||||
/// `Gtk.Editable.delete_text`.
|
||||
var deleteText: (() -> Void)?
|
||||
/// Emitted when text is inserted into the widget by the user.
|
||||
///
|
||||
@ -149,7 +128,7 @@ public struct SearchEntry: AdwaitaWidget {
|
||||
/// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>g</kbd>.
|
||||
var previousMatch: (() -> Void)?
|
||||
/// Emitted with a delay. The length of the delay can be
|
||||
/// changed with the [property@Gtk.SearchEntry:search-delay]
|
||||
/// changed with the ``searchDelay(_:)``
|
||||
/// property.
|
||||
var searchChanged: (() -> Void)?
|
||||
/// Emitted when the user initiated a search on the entry.
|
||||
@ -403,7 +382,7 @@ if let text, newValue != text.wrappedValue {
|
||||
/// range of deleted text, or prevent it from being deleted entirely.
|
||||
///
|
||||
/// The @start_pos and @end_pos parameters are interpreted as for
|
||||
/// [method@Gtk.Editable.delete_text].
|
||||
/// `Gtk.Editable.delete_text`.
|
||||
public func deleteText(_ deleteText: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.deleteText = deleteText
|
||||
@ -454,7 +433,7 @@ if let text, newValue != text.wrappedValue {
|
||||
}
|
||||
|
||||
/// Emitted with a delay. The length of the delay can be
|
||||
/// changed with the [property@Gtk.SearchEntry:search-delay]
|
||||
/// changed with the ``searchDelay(_:)``
|
||||
/// property.
|
||||
public func searchChanged(_ searchChanged: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Separator.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,20 +10,13 @@ import LevenshteinTransformations
|
||||
|
||||
/// Draws a horizontal or vertical line to separate other widgets.
|
||||
///
|
||||
/// <picture><source srcset="separator-dark.png" media="(prefers-color-scheme: dark)"><img alt="An example GtkSeparator" src="separator.png"></picture>
|
||||
///
|
||||
///
|
||||
/// A `GtkSeparator` can be used to group the widgets within a window.
|
||||
/// It displays a line with a shadow to make it appear sunken into the
|
||||
/// interface.
|
||||
///
|
||||
/// # CSS nodes
|
||||
///
|
||||
/// `GtkSeparator` has a single CSS node with name separator. The node
|
||||
/// gets one of the .horizontal or .vertical style classes.
|
||||
///
|
||||
/// # Accessibility
|
||||
///
|
||||
/// `GtkSeparator` uses the [enum@Gtk.AccessibleRole.separator] role.
|
||||
public struct Separator: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,15 +2,15 @@
|
||||
// SpinRow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// An [class@ActionRow] with an embedded spin button.
|
||||
/// An `ActionRow` with an embedded spin button.
|
||||
///
|
||||
///
|
||||
/// <picture><source srcset="spin-row-dark.png" media="(prefers-color-scheme: dark)"><img src="spin-row.png" alt="spin-row"></picture>
|
||||
///
|
||||
/// Example of an `AdwSpinRow` UI definition:
|
||||
///
|
||||
@ -18,17 +18,9 @@ import LevenshteinTransformations
|
||||
/// <object class="AdwSpinRow"><property name="title" translatable="yes">Spin Row</property><property name="adjustment"><object class="GtkAdjustment"><property name="lower">0</property><property name="upper">100</property><property name="value">50</property><property name="page-increment">10</property><property name="step-increment">1</property></object></property></object>
|
||||
/// ```
|
||||
///
|
||||
/// See [class@Gtk.SpinButton] for details.
|
||||
/// See `Gtk.SpinButton` for details.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwSpinRow` has the same structure as [class@ActionRow], as well as the
|
||||
/// `.spin` style class on the main node.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwSpinRow` uses an internal `GtkSpinButton` with the
|
||||
/// `GTK_ACCESSIBLE_ROLE_SPIN_BUTTON` role.
|
||||
public struct SpinRow: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -39,12 +31,12 @@ public struct SpinRow: AdwaitaWidget {
|
||||
/// The widget to activate when the row is activated.
|
||||
///
|
||||
/// The row can be activated either by clicking on it, calling
|
||||
/// [method@ActionRow.activate], or via mnemonics in the title.
|
||||
/// See the [property@PreferencesRow:use-underline] property to enable
|
||||
/// `ActionRow.activate`, or via mnemonics in the title.
|
||||
/// See the ``useUnderline(_:)`` property to enable
|
||||
/// mnemonics.
|
||||
///
|
||||
/// The target widget will be activated by emitting the
|
||||
/// [signal@Gtk.Widget::mnemonic-activate] signal on it.
|
||||
/// `Gtk.Widget::mnemonic-activate` signal on it.
|
||||
var activatableWidget: (() -> Body)?
|
||||
/// The acceleration rate when you hold down a button or key.
|
||||
var climbRate: Double
|
||||
@ -57,7 +49,7 @@ public struct SpinRow: AdwaitaWidget {
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var subtitle: String?
|
||||
/// The number of lines at the end of which the subtitle label will be
|
||||
/// ellipsized.
|
||||
@ -66,12 +58,12 @@ public struct SpinRow: AdwaitaWidget {
|
||||
var subtitleLines: Int?
|
||||
/// Whether the user can copy the subtitle from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var subtitleSelectable: Bool?
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var title: String?
|
||||
/// The number of lines at the end of which the title label will be ellipsized.
|
||||
///
|
||||
@ -79,13 +71,13 @@ public struct SpinRow: AdwaitaWidget {
|
||||
var titleLines: Int?
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var titleSelectable: Bool?
|
||||
/// Whether to use Pango markup for the title label.
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// Whether an embedded underline in the title indicates a mnemonic.
|
||||
var useUnderline: Bool?
|
||||
@ -97,20 +89,20 @@ public struct SpinRow: AdwaitaWidget {
|
||||
var activated: (() -> Void)?
|
||||
/// Emitted to convert the user's input into a double value.
|
||||
///
|
||||
/// The signal handler is expected to use [method@Gtk.Editable.get_text] to
|
||||
/// The signal handler is expected to use `Gtk.Editable.get_text` to
|
||||
/// retrieve the text of the spinbutton and set new_value to the new value.
|
||||
///
|
||||
/// The default conversion uses [func@GLib.strtod].
|
||||
/// The default conversion uses `GLib.strtod`.
|
||||
///
|
||||
/// See [signal@Gtk.SpinButton::input].
|
||||
/// See `Gtk.SpinButton::input`.
|
||||
var input: (() -> Void)?
|
||||
/// Emitted to tweak the formatting of the value for display.
|
||||
///
|
||||
/// See [signal@Gtk.SpinButton::output].
|
||||
/// See `Gtk.SpinButton::output`.
|
||||
var output: (() -> Void)?
|
||||
/// Emitted right after the spinbutton wraps.
|
||||
///
|
||||
/// See [signal@Gtk.SpinButton::wrapped].
|
||||
/// See `Gtk.SpinButton::wrapped`.
|
||||
var wrapped: (() -> Void)?
|
||||
/// The body for the widget "suffix".
|
||||
var suffix: () -> Body = { [] }
|
||||
@ -249,12 +241,12 @@ if let value, newValue != value.wrappedValue {
|
||||
/// The widget to activate when the row is activated.
|
||||
///
|
||||
/// The row can be activated either by clicking on it, calling
|
||||
/// [method@ActionRow.activate], or via mnemonics in the title.
|
||||
/// See the [property@PreferencesRow:use-underline] property to enable
|
||||
/// `ActionRow.activate`, or via mnemonics in the title.
|
||||
/// See the ``useUnderline(_:)`` property to enable
|
||||
/// mnemonics.
|
||||
///
|
||||
/// The target widget will be activated by emitting the
|
||||
/// [signal@Gtk.Widget::mnemonic-activate] signal on it.
|
||||
/// `Gtk.Widget::mnemonic-activate` signal on it.
|
||||
public func activatableWidget(@ViewBuilder _ activatableWidget: @escaping (() -> Body)) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.activatableWidget = activatableWidget
|
||||
@ -292,7 +284,7 @@ if let value, newValue != value.wrappedValue {
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func subtitle(_ subtitle: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitle = subtitle
|
||||
@ -311,7 +303,7 @@ if let value, newValue != value.wrappedValue {
|
||||
|
||||
/// Whether the user can copy the subtitle from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func subtitleSelectable(_ subtitleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitleSelectable = subtitleSelectable
|
||||
@ -321,7 +313,7 @@ if let value, newValue != value.wrappedValue {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func title(_ title: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -339,7 +331,7 @@ if let value, newValue != value.wrappedValue {
|
||||
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func titleSelectable(_ titleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.titleSelectable = titleSelectable
|
||||
@ -350,7 +342,7 @@ if let value, newValue != value.wrappedValue {
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
@ -387,12 +379,12 @@ if let value, newValue != value.wrappedValue {
|
||||
|
||||
/// Emitted to convert the user's input into a double value.
|
||||
///
|
||||
/// The signal handler is expected to use [method@Gtk.Editable.get_text] to
|
||||
/// The signal handler is expected to use `Gtk.Editable.get_text` to
|
||||
/// retrieve the text of the spinbutton and set new_value to the new value.
|
||||
///
|
||||
/// The default conversion uses [func@GLib.strtod].
|
||||
/// The default conversion uses `GLib.strtod`.
|
||||
///
|
||||
/// See [signal@Gtk.SpinButton::input].
|
||||
/// See `Gtk.SpinButton::input`.
|
||||
public func input(_ input: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.input = input
|
||||
@ -401,7 +393,7 @@ if let value, newValue != value.wrappedValue {
|
||||
|
||||
/// Emitted to tweak the formatting of the value for display.
|
||||
///
|
||||
/// See [signal@Gtk.SpinButton::output].
|
||||
/// See `Gtk.SpinButton::output`.
|
||||
public func output(_ output: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.output = output
|
||||
@ -410,7 +402,7 @@ if let value, newValue != value.wrappedValue {
|
||||
|
||||
/// Emitted right after the spinbutton wraps.
|
||||
///
|
||||
/// See [signal@Gtk.SpinButton::wrapped].
|
||||
/// See `Gtk.SpinButton::wrapped`.
|
||||
public func wrapped(_ wrapped: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.wrapped = wrapped
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Spinner.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,14 +10,14 @@ import LevenshteinTransformations
|
||||
|
||||
/// A widget showing a loading spinner.
|
||||
///
|
||||
/// <picture><source srcset="spinner-dark.png" media="(prefers-color-scheme: dark)"><img src="spinner.png" alt="spinner"></picture>
|
||||
///
|
||||
///
|
||||
/// The size of the spinner depends on the available size, never smaller than
|
||||
/// 16×16 pixels and never larger than 64×64 pixels.
|
||||
///
|
||||
/// Use the [property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
|
||||
/// properties in combination with [property@Gtk.Widget:width-request] and
|
||||
/// [property@Gtk.Widget:height-request] for fine sizing control.
|
||||
/// Use the ``halign(_:)`` and ``valign(_:)``
|
||||
/// properties in combination with ``widthRequest(_:)`` and
|
||||
/// ``heightRequest(_:)`` for fine sizing control.
|
||||
///
|
||||
/// For example, the following snippet shows the spinner at 48×48 pixels:
|
||||
///
|
||||
@ -25,17 +25,10 @@ import LevenshteinTransformations
|
||||
/// <object class="AdwSpinner"><property name="halign">center</property><property name="valign">center</property><property name="width-request">48</property><property name="height-request">48</property></object>
|
||||
/// ```
|
||||
///
|
||||
/// See [class@SpinnerPaintable] for cases where using a widget is impractical or
|
||||
/// impossible, such as [property@StatusPage:paintable].
|
||||
/// See `SpinnerPaintable` for cases where using a widget is impractical or
|
||||
/// impossible, such as ``paintable(_:)``.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwSpinner` has a single node with the name `image` and the style class
|
||||
/// `.spinner`.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwSpinner` uses the [enum@Gtk.AccessibleRole.progress-bar] role.
|
||||
public struct Spinner: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// SplitButton.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,47 +10,15 @@ import LevenshteinTransformations
|
||||
|
||||
/// A combined button and dropdown widget.
|
||||
///
|
||||
/// <picture><source srcset="split-button-dark.png" media="(prefers-color-scheme: dark)"><img src="split-button.png" alt="split-button"></picture>
|
||||
///
|
||||
///
|
||||
/// `AdwSplitButton` is typically used to present a set of actions in a menu,
|
||||
/// but allow access to one of them with a single click.
|
||||
///
|
||||
/// The API is very similar to [class@Gtk.Button] and [class@Gtk.MenuButton], see
|
||||
/// The API is very similar to `Gtk.Button` and `Gtk.MenuButton`, see
|
||||
/// their documentation for details.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// ```
|
||||
/// splitbutton[.image-button][.text-button]
|
||||
/// ├── button
|
||||
/// │ ╰── <content>├── separator
|
||||
/// ╰── menubutton
|
||||
/// ╰── button.toggle
|
||||
/// ╰── arrow
|
||||
/// ```
|
||||
///
|
||||
/// `AdwSplitButton`'s CSS node is called `splitbutton`. It contains the css
|
||||
/// nodes: `button`, `separator`, `menubutton`. See [class@Gtk.MenuButton]
|
||||
/// documentation for the `menubutton` contents.
|
||||
///
|
||||
/// The main CSS node will contain the `.image-button` or `.text-button` style
|
||||
/// classes matching the button contents. The nested button nodes will never
|
||||
/// contain them.
|
||||
///
|
||||
/// ## Style classes
|
||||
///
|
||||
/// `AdwSplitButton` can use some of the same style classes as [class@Gtk.Button]:
|
||||
///
|
||||
/// - [`.suggested-action`](style-classes.html#suggested-action)
|
||||
/// - [`.destructive-action`](style-classes.html#destructive-action)
|
||||
/// - [`.flat`](style-classes.html#flat)
|
||||
/// - [`.raised`](style-classes.html#raised)
|
||||
///
|
||||
/// Other style classes, like `.pill`, cannot be used.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwSplitButton` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
|
||||
public struct SplitButton: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -60,15 +28,15 @@ public struct SplitButton: AdwaitaWidget {
|
||||
|
||||
/// Whether the button can be smaller than the natural size of its contents.
|
||||
///
|
||||
/// If set to `TRUE`, the label will ellipsize.
|
||||
/// If set to `true`, the label will ellipsize.
|
||||
///
|
||||
/// See [property@Gtk.Button:can-shrink] and
|
||||
/// [property@Gtk.MenuButton:can-shrink].
|
||||
/// See ``canShrink(_:)`` and
|
||||
/// ``canShrink(_:)``.
|
||||
var canShrink: Bool?
|
||||
/// The child widget.
|
||||
///
|
||||
/// Setting the child widget will set [property@SplitButton:label] and
|
||||
/// [property@SplitButton:icon-name] to `NULL`.
|
||||
/// Setting the child widget will set ``label(_:)`` and
|
||||
/// ``iconName(_:)`` to `NULL`.
|
||||
var child: (() -> Body)?
|
||||
/// The tooltip of the dropdown button.
|
||||
///
|
||||
@ -76,33 +44,33 @@ public struct SplitButton: AdwaitaWidget {
|
||||
var dropdownTooltip: String?
|
||||
/// The name of the icon used to automatically populate the button.
|
||||
///
|
||||
/// Setting the icon name will set [property@SplitButton:label] and
|
||||
/// [property@SplitButton:child] to `NULL`.
|
||||
/// Setting the icon name will set ``label(_:)`` and
|
||||
/// ``child(_:)`` to `NULL`.
|
||||
var iconName: String?
|
||||
/// The label for the button.
|
||||
///
|
||||
/// Setting the label will set [property@SplitButton:icon-name] and
|
||||
/// [property@SplitButton:child] to `NULL`.
|
||||
/// Setting the label will set ``iconName(_:)`` and
|
||||
/// ``child(_:)`` to `NULL`.
|
||||
var label: String?
|
||||
/// The `GMenuModel` from which the popup will be created.
|
||||
///
|
||||
/// If the menu model is `NULL`, the dropdown is disabled.
|
||||
///
|
||||
/// A [class@Gtk.Popover] will be created from the menu model with
|
||||
/// [ctor@Gtk.PopoverMenu.new_from_model]. Actions will be connected as
|
||||
/// A `Gtk.Popover` will be created from the menu model with
|
||||
/// `Gtk.PopoverMenu.new_from_model`. Actions will be connected as
|
||||
/// documented for this function.
|
||||
///
|
||||
/// If [property@SplitButton:popover] is already set, it will be dissociated
|
||||
/// If ``popover(_:)`` is already set, it will be dissociated
|
||||
/// from the button, and the property is set to `NULL`.
|
||||
var menuModel: (() -> Body)?
|
||||
/// Whether an underline in the text indicates a mnemonic.
|
||||
///
|
||||
/// See [property@SplitButton:label].
|
||||
/// See ``label(_:)``.
|
||||
var useUnderline: Bool?
|
||||
/// Emitted to animate press then release.
|
||||
///
|
||||
/// This is an action signal. Applications should never connect to this signal,
|
||||
/// but use the [signal@SplitButton::clicked] signal.
|
||||
/// but use the `SplitButton::clicked` signal.
|
||||
var activate: (() -> Void)?
|
||||
/// Emitted when the button has been activated (pressed and released).
|
||||
var clicked: (() -> Void)?
|
||||
@ -190,10 +158,10 @@ public struct SplitButton: AdwaitaWidget {
|
||||
|
||||
/// Whether the button can be smaller than the natural size of its contents.
|
||||
///
|
||||
/// If set to `TRUE`, the label will ellipsize.
|
||||
/// If set to `true`, the label will ellipsize.
|
||||
///
|
||||
/// See [property@Gtk.Button:can-shrink] and
|
||||
/// [property@Gtk.MenuButton:can-shrink].
|
||||
/// See ``canShrink(_:)`` and
|
||||
/// ``canShrink(_:)``.
|
||||
public func canShrink(_ canShrink: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.canShrink = canShrink
|
||||
@ -202,8 +170,8 @@ public struct SplitButton: AdwaitaWidget {
|
||||
|
||||
/// The child widget.
|
||||
///
|
||||
/// Setting the child widget will set [property@SplitButton:label] and
|
||||
/// [property@SplitButton:icon-name] to `NULL`.
|
||||
/// Setting the child widget will set ``label(_:)`` and
|
||||
/// ``iconName(_:)`` to `NULL`.
|
||||
public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.child = child
|
||||
@ -221,8 +189,8 @@ public struct SplitButton: AdwaitaWidget {
|
||||
|
||||
/// The name of the icon used to automatically populate the button.
|
||||
///
|
||||
/// Setting the icon name will set [property@SplitButton:label] and
|
||||
/// [property@SplitButton:child] to `NULL`.
|
||||
/// Setting the icon name will set ``label(_:)`` and
|
||||
/// ``child(_:)`` to `NULL`.
|
||||
public func iconName(_ iconName: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.iconName = iconName
|
||||
@ -231,8 +199,8 @@ public struct SplitButton: AdwaitaWidget {
|
||||
|
||||
/// The label for the button.
|
||||
///
|
||||
/// Setting the label will set [property@SplitButton:icon-name] and
|
||||
/// [property@SplitButton:child] to `NULL`.
|
||||
/// Setting the label will set ``iconName(_:)`` and
|
||||
/// ``child(_:)`` to `NULL`.
|
||||
public func label(_ label: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.label = label
|
||||
@ -243,11 +211,11 @@ public struct SplitButton: AdwaitaWidget {
|
||||
///
|
||||
/// If the menu model is `NULL`, the dropdown is disabled.
|
||||
///
|
||||
/// A [class@Gtk.Popover] will be created from the menu model with
|
||||
/// [ctor@Gtk.PopoverMenu.new_from_model]. Actions will be connected as
|
||||
/// A `Gtk.Popover` will be created from the menu model with
|
||||
/// `Gtk.PopoverMenu.new_from_model`. Actions will be connected as
|
||||
/// documented for this function.
|
||||
///
|
||||
/// If [property@SplitButton:popover] is already set, it will be dissociated
|
||||
/// If ``popover(_:)`` is already set, it will be dissociated
|
||||
/// from the button, and the property is set to `NULL`.
|
||||
public func menuModel(@ViewBuilder _ menuModel: @escaping (() -> Body)) -> Self {
|
||||
var newSelf = self
|
||||
@ -257,7 +225,7 @@ public struct SplitButton: AdwaitaWidget {
|
||||
|
||||
/// Whether an underline in the text indicates a mnemonic.
|
||||
///
|
||||
/// See [property@SplitButton:label].
|
||||
/// See ``label(_:)``.
|
||||
public func useUnderline(_ useUnderline: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useUnderline = useUnderline
|
||||
@ -267,7 +235,7 @@ public struct SplitButton: AdwaitaWidget {
|
||||
/// Emitted to animate press then release.
|
||||
///
|
||||
/// This is an action signal. Applications should never connect to this signal,
|
||||
/// but use the [signal@SplitButton::clicked] signal.
|
||||
/// but use the `SplitButton::clicked` signal.
|
||||
public func activate(_ activate: @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.activate = activate
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// StatusPage.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,27 +10,12 @@ import LevenshteinTransformations
|
||||
|
||||
/// A page used for empty/error states and similar use-cases.
|
||||
///
|
||||
/// <picture><source srcset="status-page-dark.png" media="(prefers-color-scheme: dark)"><img src="status-page.png" alt="status-page"></picture>
|
||||
///
|
||||
///
|
||||
/// The `AdwStatusPage` widget can have an icon, a title, a description and a
|
||||
/// custom widget which is displayed below them.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwStatusPage` has a main CSS node with name `statuspage`.
|
||||
///
|
||||
/// When setting an [class@SpinnerPaintable] as [property@StatusPage:paintable],
|
||||
/// the main nodes gains the `.spinner` style class for a more compact
|
||||
/// appearance.
|
||||
///
|
||||
/// ## Style classes
|
||||
///
|
||||
/// `AdwStatusPage` can use the
|
||||
/// [`.compact`](style-classes.html#compact-status-page) style class for when it
|
||||
/// needs to fit into a small space such a sidebar or a popover, similar to when
|
||||
/// using a spinner as the paintable.
|
||||
///
|
||||
/// <picture><source srcset="status-page-compact-dark.png" media="(prefers-color-scheme: dark)"><img src="status-page-compact.png" alt="status-page-compact"></picture>
|
||||
public struct StatusPage: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -44,7 +29,7 @@ public struct StatusPage: AdwaitaWidget {
|
||||
var description: String?
|
||||
/// The name of the icon to be used.
|
||||
///
|
||||
/// Changing this will set [property@StatusPage:paintable] to `NULL`.
|
||||
/// Changing this will set ``paintable(_:)`` to `NULL`.
|
||||
var iconName: String?
|
||||
/// The title to be displayed below the icon.
|
||||
///
|
||||
@ -123,7 +108,7 @@ public struct StatusPage: AdwaitaWidget {
|
||||
|
||||
/// The name of the icon to be used.
|
||||
///
|
||||
/// Changing this will set [property@StatusPage:paintable] to `NULL`.
|
||||
/// Changing this will set ``paintable(_:)`` to `NULL`.
|
||||
public func iconName(_ iconName: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.iconName = iconName
|
||||
|
||||
@ -2,36 +2,34 @@
|
||||
// SwitchRow.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
/// A [class@Gtk.ListBoxRow] used to represent two states.
|
||||
/// A `Gtk.ListBoxRow` used to represent two states.
|
||||
///
|
||||
/// <picture><source srcset="switch-row-dark.png" media="(prefers-color-scheme: dark)"><img src="switch-row.png" alt="switch-row"></picture>
|
||||
///
|
||||
/// The `AdwSwitchRow` widget contains a [class@Gtk.Switch] that allows the user
|
||||
///
|
||||
/// The `AdwSwitchRow` widget contains a `Gtk.Switch` that allows the user
|
||||
/// to select between two states: "on" or "off". When activated, the row will
|
||||
/// invert its active state.
|
||||
///
|
||||
/// The user can control the switch by activating the row or by dragging on the
|
||||
/// switch handle.
|
||||
///
|
||||
/// See [class@Gtk.Switch] for details.
|
||||
/// See `Gtk.Switch` for details.
|
||||
///
|
||||
/// Example of an `AdwSwitchRow` UI definition:
|
||||
/// ```xml
|
||||
/// <object class="AdwSwitchRow"><property name="title" translatable="yes">Switch Row</property><signal name="notify::active" handler="switch_row_notify_active_cb"/></object>
|
||||
/// ```
|
||||
///
|
||||
/// The [property@SwitchRow:active] property should be connected to in order to
|
||||
/// The ``active(_:)`` property should be connected to in order to
|
||||
/// monitor changes to the active state.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwSwitchRow` uses the `GTK_ACCESSIBLE_ROLE_SWITCH` role.
|
||||
public struct SwitchRow: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -42,19 +40,19 @@ public struct SwitchRow: AdwaitaWidget {
|
||||
/// The widget to activate when the row is activated.
|
||||
///
|
||||
/// The row can be activated either by clicking on it, calling
|
||||
/// [method@ActionRow.activate], or via mnemonics in the title.
|
||||
/// See the [property@PreferencesRow:use-underline] property to enable
|
||||
/// `ActionRow.activate`, or via mnemonics in the title.
|
||||
/// See the ``useUnderline(_:)`` property to enable
|
||||
/// mnemonics.
|
||||
///
|
||||
/// The target widget will be activated by emitting the
|
||||
/// [signal@Gtk.Widget::mnemonic-activate] signal on it.
|
||||
/// `Gtk.Widget::mnemonic-activate` signal on it.
|
||||
var activatableWidget: (() -> Body)?
|
||||
/// Whether the switch row is in the "on" or "off" position.
|
||||
var active: Binding<Bool>?
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var subtitle: String?
|
||||
/// The number of lines at the end of which the subtitle label will be
|
||||
/// ellipsized.
|
||||
@ -63,12 +61,12 @@ public struct SwitchRow: AdwaitaWidget {
|
||||
var subtitleLines: Int?
|
||||
/// Whether the user can copy the subtitle from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var subtitleSelectable: Bool?
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
var title: String?
|
||||
/// The number of lines at the end of which the title label will be ellipsized.
|
||||
///
|
||||
@ -76,13 +74,13 @@ public struct SwitchRow: AdwaitaWidget {
|
||||
var titleLines: Int?
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
var titleSelectable: Bool?
|
||||
/// Whether to use Pango markup for the title label.
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
var useMarkup: Bool?
|
||||
/// Whether an embedded underline in the title indicates a mnemonic.
|
||||
var useUnderline: Bool?
|
||||
@ -193,12 +191,12 @@ if let active, newValue != active.wrappedValue {
|
||||
/// The widget to activate when the row is activated.
|
||||
///
|
||||
/// The row can be activated either by clicking on it, calling
|
||||
/// [method@ActionRow.activate], or via mnemonics in the title.
|
||||
/// See the [property@PreferencesRow:use-underline] property to enable
|
||||
/// `ActionRow.activate`, or via mnemonics in the title.
|
||||
/// See the ``useUnderline(_:)`` property to enable
|
||||
/// mnemonics.
|
||||
///
|
||||
/// The target widget will be activated by emitting the
|
||||
/// [signal@Gtk.Widget::mnemonic-activate] signal on it.
|
||||
/// `Gtk.Widget::mnemonic-activate` signal on it.
|
||||
public func activatableWidget(@ViewBuilder _ activatableWidget: @escaping (() -> Body)) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.activatableWidget = activatableWidget
|
||||
@ -215,7 +213,7 @@ if let active, newValue != active.wrappedValue {
|
||||
/// The subtitle for this row.
|
||||
///
|
||||
/// The subtitle is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func subtitle(_ subtitle: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitle = subtitle
|
||||
@ -234,7 +232,7 @@ if let active, newValue != active.wrappedValue {
|
||||
|
||||
/// Whether the user can copy the subtitle from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func subtitleSelectable(_ subtitleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.subtitleSelectable = subtitleSelectable
|
||||
@ -244,7 +242,7 @@ if let active, newValue != active.wrappedValue {
|
||||
/// The title of the preference represented by this row.
|
||||
///
|
||||
/// The title is interpreted as Pango markup unless
|
||||
/// [property@PreferencesRow:use-markup] is set to `FALSE`.
|
||||
/// ``useMarkup(_:)`` is set to `false`.
|
||||
public func title(_ title: String?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.title = title
|
||||
@ -262,7 +260,7 @@ if let active, newValue != active.wrappedValue {
|
||||
|
||||
/// Whether the user can copy the title from the label.
|
||||
///
|
||||
/// See also [property@Gtk.Label:selectable].
|
||||
/// See also ``selectable(_:)``.
|
||||
public func titleSelectable(_ titleSelectable: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.titleSelectable = titleSelectable
|
||||
@ -273,7 +271,7 @@ if let active, newValue != active.wrappedValue {
|
||||
///
|
||||
/// Subclasses may also use it for other labels, such as subtitle.
|
||||
///
|
||||
/// See also [func@Pango.parse_markup].
|
||||
/// See also `Pango.parse_markup`.
|
||||
public func useMarkup(_ useMarkup: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.useMarkup = useMarkup
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// ToastOverlay.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,43 +10,18 @@ import LevenshteinTransformations
|
||||
|
||||
/// A widget showing toasts above its content.
|
||||
///
|
||||
/// <picture><source srcset="toast-overlay-dark.png" media="(prefers-color-scheme: dark)"><img src="toast-overlay.png" alt="toast-overlay"></picture>
|
||||
///
|
||||
/// Much like [class@Gtk.Overlay], `AdwToastOverlay` is a container with a single
|
||||
/// main child, on top of which it can display a [class@Toast], overlaid.
|
||||
/// Toasts can be shown with [method@ToastOverlay.add_toast].
|
||||
///
|
||||
/// Use [method@ToastOverlay.dismiss_all] to dismiss all toasts at once, or
|
||||
/// [method@Toast.dismiss] to dismiss a single toast.
|
||||
/// Much like `Gtk.Overlay`, `AdwToastOverlay` is a container with a single
|
||||
/// main child, on top of which it can display a `Toast`, overlaid.
|
||||
/// Toasts can be shown with `ToastOverlay.add_toast`.
|
||||
///
|
||||
/// See [class@Toast] for details.
|
||||
/// Use `ToastOverlay.dismiss_all` to dismiss all toasts at once, or
|
||||
/// `Toast.dismiss` to dismiss a single toast.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
/// See `Toast` for details.
|
||||
///
|
||||
/// ```
|
||||
/// toastoverlay
|
||||
/// ├── [child]
|
||||
/// ├── toast
|
||||
/// ┊ ├── widget
|
||||
/// ┊ │ ├── [label.heading]
|
||||
/// │ ╰── [custom title]
|
||||
/// ├── [button]
|
||||
/// ╰── button.circular.flat
|
||||
/// ```
|
||||
///
|
||||
/// `AdwToastOverlay`'s CSS node is called `toastoverlay`. It contains the child,
|
||||
/// as well as zero or more `toast` subnodes.
|
||||
///
|
||||
/// Each of the `toast` nodes contains a `widget` subnode, optionally a `button`
|
||||
/// subnode, and another `button` subnode with `.circular` and `.flat` style
|
||||
/// classes.
|
||||
///
|
||||
/// The `widget` subnode contains a `label` subnode with the `.heading` style
|
||||
/// class, or a custom widget provided by the application.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwToastOverlay` uses the [enum@Gtk.AccessibleRole.GROUP] role.
|
||||
public struct ToastOverlay: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// ToggleButton.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,77 +10,20 @@ import LevenshteinTransformations
|
||||
|
||||
/// Shows a button which remains “pressed-in” when clicked.
|
||||
///
|
||||
/// <picture><source srcset="toggle-button-dark.png" media="(prefers-color-scheme: dark)"><img alt="Example GtkToggleButtons" src="toggle-button.png"></picture>
|
||||
///
|
||||
///
|
||||
/// Clicking again will cause the toggle button to return to its normal state.
|
||||
///
|
||||
/// A toggle button is created by calling either [ctor@Gtk.ToggleButton.new] or
|
||||
/// [ctor@Gtk.ToggleButton.new_with_label]. If using the former, it is advisable
|
||||
/// A toggle button is created by calling either `Gtk.ToggleButton.new` or
|
||||
/// `Gtk.ToggleButton.new_with_label`. If using the former, it is advisable
|
||||
/// to pack a widget, (such as a `GtkLabel` and/or a `GtkImage`), into the toggle
|
||||
/// button’s container. (See [class@Gtk.Button] for more information).
|
||||
/// button’s container. (See `Gtk.Button` for more information).
|
||||
///
|
||||
/// The state of a `GtkToggleButton` can be set specifically using
|
||||
/// [method@Gtk.ToggleButton.set_active], and retrieved using
|
||||
/// [method@Gtk.ToggleButton.get_active].
|
||||
/// `Gtk.ToggleButton.set_active`, and retrieved using
|
||||
/// `Gtk.ToggleButton.get_active`.
|
||||
///
|
||||
/// ## Grouping
|
||||
///
|
||||
/// Toggle buttons can be grouped together, to form mutually exclusive
|
||||
/// groups - only one of the buttons can be toggled at a time, and toggling
|
||||
/// another one will switch the currently toggled one off.
|
||||
///
|
||||
/// To add a `GtkToggleButton` to a group, use [method@Gtk.ToggleButton.set_group].
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `GtkToggleButton` has a single CSS node with name button. To differentiate
|
||||
/// it from a plain `GtkButton`, it gets the `.toggle` style class.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `GtkToggleButton` uses the [enum@Gtk.AccessibleRole.toggle_button] role.
|
||||
///
|
||||
/// ## Creating two `GtkToggleButton` widgets.
|
||||
///
|
||||
/// ```c
|
||||
/// static void
|
||||
/// output_state (GtkToggleButton *source,
|
||||
/// gpointer user_data)
|
||||
/// {
|
||||
/// g_print ("Toggle button "%s" is active: %s",
|
||||
/// gtk_button_get_label (GTK_BUTTON (source)),
|
||||
/// gtk_toggle_button_get_active (source) ? "Yes" : "No");
|
||||
/// }
|
||||
///
|
||||
/// static void
|
||||
/// make_toggles (void)
|
||||
/// {
|
||||
/// GtkWidget *window, *toggle1, *toggle2;
|
||||
/// GtkWidget *box;
|
||||
/// const char *text;
|
||||
///
|
||||
/// window = gtk_window_new ();
|
||||
/// box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
///
|
||||
/// text = "Hi, I’m toggle button one";
|
||||
/// toggle1 = gtk_toggle_button_new_with_label (text);
|
||||
///
|
||||
/// g_signal_connect (toggle1, "toggled",
|
||||
/// G_CALLBACK (output_state),
|
||||
/// NULL);
|
||||
/// gtk_box_append (GTK_BOX (box), toggle1);
|
||||
///
|
||||
/// text = "Hi, I’m toggle button two";
|
||||
/// toggle2 = gtk_toggle_button_new_with_label (text);
|
||||
/// g_signal_connect (toggle2, "toggled",
|
||||
/// G_CALLBACK (output_state),
|
||||
/// NULL);
|
||||
/// gtk_box_append (GTK_BOX (box), toggle2);
|
||||
///
|
||||
/// gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
/// gtk_window_present (GTK_WINDOW (window));
|
||||
/// }
|
||||
/// ```
|
||||
public struct ToggleButton: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -118,7 +61,7 @@ public struct ToggleButton: AdwaitaWidget {
|
||||
/// Emitted to animate press then release.
|
||||
///
|
||||
/// This is an action signal. Applications should never connect
|
||||
/// to this signal, but use the [signal@Gtk.Button::clicked] signal.
|
||||
/// to this signal, but use the `Gtk.Button::clicked` signal.
|
||||
///
|
||||
/// The default bindings for this signal are all forms of the
|
||||
/// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
@ -292,7 +235,7 @@ if let active, newValue != active.wrappedValue {
|
||||
/// Emitted to animate press then release.
|
||||
///
|
||||
/// This is an action signal. Applications should never connect
|
||||
/// to this signal, but use the [signal@Gtk.Button::clicked] signal.
|
||||
/// to this signal, but use the `Gtk.Button::clicked` signal.
|
||||
///
|
||||
/// The default bindings for this signal are all forms of the
|
||||
/// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// ToolbarView.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,7 +10,7 @@ import LevenshteinTransformations
|
||||
|
||||
/// A widget containing a page, as well as top and/or bottom bars.
|
||||
///
|
||||
/// <picture><source srcset="toolbar-view-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view.png" alt="toolbar-view"></picture>
|
||||
///
|
||||
///
|
||||
/// `AdwToolbarView` has a single content widget and one or multiple top and
|
||||
/// bottom bars, shown at the top and bottom sides respectively.
|
||||
@ -22,60 +22,15 @@ import LevenshteinTransformations
|
||||
///
|
||||
/// The following kinds of top and bottom bars are supported:
|
||||
///
|
||||
/// - [class@HeaderBar]
|
||||
/// - [class@TabBar]
|
||||
/// - [class@ViewSwitcherBar]
|
||||
/// - [class@Gtk.ActionBar]
|
||||
/// - [class@Gtk.HeaderBar]
|
||||
/// - [class@Gtk.PopoverMenuBar]
|
||||
/// - [class@Gtk.SearchBar]
|
||||
/// - Any [class@Gtk.Box] or a similar widget with the
|
||||
/// [`.toolbar`](style-classes.html#toolbars) style class
|
||||
///
|
||||
/// By default, top and bottom bars are flat and scrolling content has a subtle
|
||||
/// undershoot shadow, same as when using the
|
||||
/// [`.undershoot-top`](style-classes.html#undershoot-indicators) and
|
||||
/// [`.undershoot-bottom`](style-classes.html#undershoot-indicators) style
|
||||
/// classes. This works well in most cases, e.g. with [class@StatusPage] or
|
||||
/// [class@PreferencesPage], where the background at the top and bottom parts of
|
||||
/// the page is uniform. Additionally, windows with sidebars should always use
|
||||
/// this style.
|
||||
///
|
||||
/// [property@ToolbarView:top-bar-style] and
|
||||
/// [property@ToolbarView:bottom-bar-style] properties can be used add an opaque
|
||||
/// background and a persistent shadow to top and bottom bars, this can be useful
|
||||
/// for content such as [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
|
||||
/// where some elements are adjacent to the top/bottom bars, or [class@TabView],
|
||||
/// where each page can have a different background.
|
||||
///
|
||||
/// <picture style="min-width: 33%; display: inline-block;"><source srcset="toolbar-view-flat-1-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-flat-1.png" alt="toolbar-view-flat-1"></picture><picture style="min-width: 33%; display: inline-block;"><source srcset="toolbar-view-flat-2-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-flat-2.png" alt="toolbar-view-flat-2"></picture><picture style="min-width: 33%; display: inline-block;"><source srcset="toolbar-view-raised-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-raised.png" alt="toolbar-view-raised"></picture>
|
||||
///
|
||||
/// `AdwToolbarView` ensures the top and bottom bars have consistent backdrop
|
||||
/// styles and vertical spacing. For comparison:
|
||||
///
|
||||
/// <picture style="min-width: 40%; display: inline-block;"><source srcset="toolbar-view-spacing-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-spacing.png" alt="toolbar-view-spacing"></picture><picture style="min-width: 40%; display: inline-block;"><source srcset="toolbar-view-spacing-box-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-spacing-box.png" alt="toolbar-view-spacing-box"></picture>
|
||||
///
|
||||
/// Any top and bottom bars can also be dragged to move the window, equivalent
|
||||
/// to putting them into a [class@Gtk.WindowHandle].
|
||||
///
|
||||
/// Content is typically place between top and bottom bars, but can also extend
|
||||
/// behind them. This is controlled with the
|
||||
/// [property@ToolbarView:extend-content-to-top-edge] and
|
||||
/// [property@ToolbarView:extend-content-to-bottom-edge] properties.
|
||||
///
|
||||
/// Top and bottom bars can be hidden and revealed with an animation using the
|
||||
/// [property@ToolbarView:reveal-top-bars] and
|
||||
/// [property@ToolbarView:reveal-bottom-bars] properties.
|
||||
///
|
||||
/// ## `AdwToolbarView` as `GtkBuildable`
|
||||
///
|
||||
/// The `AdwToolbarView` implementation of the [iface@Gtk.Buildable] interface
|
||||
/// supports adding a top bar by specifying “top” as the “type” attribute of a
|
||||
/// `<child>` element, or adding a bottom bar by specifying “bottom”.
|
||||
///
|
||||
/// ## Accessibility
|
||||
///
|
||||
/// `AdwToolbarView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
|
||||
/// - `HeaderBar`
|
||||
/// - `TabBar`
|
||||
/// - `ViewSwitcherBar`
|
||||
/// - `Gtk.ActionBar`
|
||||
/// - `Gtk.HeaderBar`
|
||||
/// - `Gtk.PopoverMenuBar`
|
||||
/// - `Gtk.SearchBar`
|
||||
/// - Any `Gtk.Box` or a similar widget with the
|
||||
/// [`.toolbar`](style-classes.html
|
||||
public struct ToolbarView: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
@ -86,103 +41,65 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
/// The current bottom bar height.
|
||||
///
|
||||
/// Bottom bar height does change depending on
|
||||
/// [property@ToolbarView:reveal-bottom-bars], including during the transition.
|
||||
/// ``revealBottomBars(_:)``, including during the transition.
|
||||
///
|
||||
/// See [property@ToolbarView:top-bar-height].
|
||||
/// See ``topBarHeight(_:)``.
|
||||
var bottomBarHeight: Int?
|
||||
/// Appearance of the bottom bars.
|
||||
///
|
||||
/// If set to `ADW_TOOLBAR_FLAT`, bottom bars are flat and scrolling content
|
||||
/// has a subtle undershoot shadow when touching them, same as the
|
||||
/// [`.undershoot-bottom`](style-classes.html#undershoot-indicators)
|
||||
/// style class. This works well for simple content, e.g. [class@StatusPage] or
|
||||
/// [class@PreferencesPage], where the background at the bottom of the page is
|
||||
/// uniform. Additionally, windows with sidebars should always use this style.
|
||||
///
|
||||
/// Undershoot shadow is only present if a bottom bar is actually present and
|
||||
/// visible. It is also never present if
|
||||
/// [property@ToolbarView:extend-content-to-bottom-edge] is set to `TRUE`.
|
||||
///
|
||||
/// If set to `ADW_TOOLBAR_RAISED`, bottom bars have an opaque background and a
|
||||
/// persistent shadow, this is suitable for content such as
|
||||
/// [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
|
||||
/// where some elements are directly adjacent to the bottom bars, or
|
||||
/// [class@TabView], where each page can have a different background.
|
||||
///
|
||||
/// `ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the
|
||||
/// shadow is replaced with a more subtle border. This can be useful for
|
||||
/// applications like image viewers.
|
||||
///
|
||||
/// See also [property@ToolbarView:top-bar-style].
|
||||
/// [`.undershoot-bottom`](style-classes.html
|
||||
var bottomBarStyle: ToolbarStyle?
|
||||
/// The content widget.
|
||||
var content: (() -> Body)?
|
||||
/// Whether the content widget can extend behind bottom bars.
|
||||
///
|
||||
/// This can be used in combination with
|
||||
/// [property@ToolbarView:reveal-bottom-bars] to show and hide toolbars in
|
||||
/// ``revealBottomBars(_:)`` to show and hide toolbars in
|
||||
/// fullscreen.
|
||||
///
|
||||
/// See [property@ToolbarView:extend-content-to-top-edge].
|
||||
/// See ``extendContentToTopEdge(_:)``.
|
||||
var extendContentToBottomEdge: Bool?
|
||||
/// Whether the content widget can extend behind top bars.
|
||||
///
|
||||
/// This can be used in combination with [property@ToolbarView:reveal-top-bars]
|
||||
/// This can be used in combination with ``revealTopBars(_:)``
|
||||
/// to show and hide toolbars in fullscreen.
|
||||
///
|
||||
/// See [property@ToolbarView:extend-content-to-bottom-edge].
|
||||
/// See ``extendContentToBottomEdge(_:)``.
|
||||
var extendContentToTopEdge: Bool?
|
||||
/// Whether bottom bars are visible.
|
||||
///
|
||||
/// The transition will be animated.
|
||||
///
|
||||
/// This can be used in combination with
|
||||
/// [property@ToolbarView:extend-content-to-bottom-edge] to show and hide
|
||||
/// ``extendContentToBottomEdge(_:)`` to show and hide
|
||||
/// toolbars in fullscreen.
|
||||
///
|
||||
/// See [property@ToolbarView:reveal-top-bars].
|
||||
/// See ``revealTopBars(_:)``.
|
||||
var revealBottomBars: Bool?
|
||||
/// Whether top bars are revealed.
|
||||
///
|
||||
/// The transition will be animated.
|
||||
///
|
||||
/// This can be used in combination with
|
||||
/// [property@ToolbarView:extend-content-to-top-edge] to show and hide toolbars
|
||||
/// ``extendContentToTopEdge(_:)`` to show and hide toolbars
|
||||
/// in fullscreen.
|
||||
///
|
||||
/// See [property@ToolbarView:reveal-bottom-bars].
|
||||
/// See ``revealBottomBars(_:)``.
|
||||
var revealTopBars: Bool?
|
||||
/// The current top bar height.
|
||||
///
|
||||
/// Top bar height does change depending [property@ToolbarView:reveal-top-bars],
|
||||
/// Top bar height does change depending ``revealTopBars(_:)``,
|
||||
/// including during the transition.
|
||||
///
|
||||
/// See [property@ToolbarView:bottom-bar-height].
|
||||
/// See ``bottomBarHeight(_:)``.
|
||||
var topBarHeight: Int?
|
||||
/// Appearance of the top bars.
|
||||
///
|
||||
/// If set to `ADW_TOOLBAR_FLAT`, top bars are flat and scrolling content has a
|
||||
/// subtle undershoot shadow when touching them, same as the
|
||||
/// [`.undershoot-top`](style-classes.html#undershoot-indicators)
|
||||
/// style class. This works well for simple content, e.g. [class@StatusPage] or
|
||||
/// [class@PreferencesPage], where the background at the top of the page is
|
||||
/// uniform. Additionally, windows with sidebars should always use this style.
|
||||
///
|
||||
/// Undershoot shadow is only present if a top bar is actually present and
|
||||
/// visible. It is also never present if
|
||||
/// [property@ToolbarView:extend-content-to-top-edge] is set to `TRUE`.
|
||||
///
|
||||
/// If set to `ADW_TOOLBAR_RAISED`, top bars have an opaque background and a
|
||||
/// persistent shadow, this is suitable for content such as
|
||||
/// [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
|
||||
/// where some elements are directly adjacent to the top bars, or
|
||||
/// [class@TabView], where each page can have a different background.
|
||||
///
|
||||
/// `ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the
|
||||
/// shadow is replaced with a more subtle border. This can be useful for
|
||||
/// applications like image viewers.
|
||||
///
|
||||
/// See also [property@ToolbarView:bottom-bar-style].
|
||||
/// [`.undershoot-top`](style-classes.html
|
||||
var topBarStyle: ToolbarStyle?
|
||||
/// The body for the widget "bottom".
|
||||
var bottom: () -> Body = { [] }
|
||||
@ -293,9 +210,9 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
/// The current bottom bar height.
|
||||
///
|
||||
/// Bottom bar height does change depending on
|
||||
/// [property@ToolbarView:reveal-bottom-bars], including during the transition.
|
||||
/// ``revealBottomBars(_:)``, including during the transition.
|
||||
///
|
||||
/// See [property@ToolbarView:top-bar-height].
|
||||
/// See ``topBarHeight(_:)``.
|
||||
public func bottomBarHeight(_ bottomBarHeight: Int?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.bottomBarHeight = bottomBarHeight
|
||||
@ -306,26 +223,7 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
///
|
||||
/// If set to `ADW_TOOLBAR_FLAT`, bottom bars are flat and scrolling content
|
||||
/// has a subtle undershoot shadow when touching them, same as the
|
||||
/// [`.undershoot-bottom`](style-classes.html#undershoot-indicators)
|
||||
/// style class. This works well for simple content, e.g. [class@StatusPage] or
|
||||
/// [class@PreferencesPage], where the background at the bottom of the page is
|
||||
/// uniform. Additionally, windows with sidebars should always use this style.
|
||||
///
|
||||
/// Undershoot shadow is only present if a bottom bar is actually present and
|
||||
/// visible. It is also never present if
|
||||
/// [property@ToolbarView:extend-content-to-bottom-edge] is set to `TRUE`.
|
||||
///
|
||||
/// If set to `ADW_TOOLBAR_RAISED`, bottom bars have an opaque background and a
|
||||
/// persistent shadow, this is suitable for content such as
|
||||
/// [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
|
||||
/// where some elements are directly adjacent to the bottom bars, or
|
||||
/// [class@TabView], where each page can have a different background.
|
||||
///
|
||||
/// `ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the
|
||||
/// shadow is replaced with a more subtle border. This can be useful for
|
||||
/// applications like image viewers.
|
||||
///
|
||||
/// See also [property@ToolbarView:top-bar-style].
|
||||
/// [`.undershoot-bottom`](style-classes.html
|
||||
public func bottomBarStyle(_ bottomBarStyle: ToolbarStyle?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.bottomBarStyle = bottomBarStyle
|
||||
@ -342,10 +240,10 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
/// Whether the content widget can extend behind bottom bars.
|
||||
///
|
||||
/// This can be used in combination with
|
||||
/// [property@ToolbarView:reveal-bottom-bars] to show and hide toolbars in
|
||||
/// ``revealBottomBars(_:)`` to show and hide toolbars in
|
||||
/// fullscreen.
|
||||
///
|
||||
/// See [property@ToolbarView:extend-content-to-top-edge].
|
||||
/// See ``extendContentToTopEdge(_:)``.
|
||||
public func extendContentToBottomEdge(_ extendContentToBottomEdge: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.extendContentToBottomEdge = extendContentToBottomEdge
|
||||
@ -354,10 +252,10 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
|
||||
/// Whether the content widget can extend behind top bars.
|
||||
///
|
||||
/// This can be used in combination with [property@ToolbarView:reveal-top-bars]
|
||||
/// This can be used in combination with ``revealTopBars(_:)``
|
||||
/// to show and hide toolbars in fullscreen.
|
||||
///
|
||||
/// See [property@ToolbarView:extend-content-to-bottom-edge].
|
||||
/// See ``extendContentToBottomEdge(_:)``.
|
||||
public func extendContentToTopEdge(_ extendContentToTopEdge: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.extendContentToTopEdge = extendContentToTopEdge
|
||||
@ -369,10 +267,10 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
/// The transition will be animated.
|
||||
///
|
||||
/// This can be used in combination with
|
||||
/// [property@ToolbarView:extend-content-to-bottom-edge] to show and hide
|
||||
/// ``extendContentToBottomEdge(_:)`` to show and hide
|
||||
/// toolbars in fullscreen.
|
||||
///
|
||||
/// See [property@ToolbarView:reveal-top-bars].
|
||||
/// See ``revealTopBars(_:)``.
|
||||
public func revealBottomBars(_ revealBottomBars: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.revealBottomBars = revealBottomBars
|
||||
@ -384,10 +282,10 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
/// The transition will be animated.
|
||||
///
|
||||
/// This can be used in combination with
|
||||
/// [property@ToolbarView:extend-content-to-top-edge] to show and hide toolbars
|
||||
/// ``extendContentToTopEdge(_:)`` to show and hide toolbars
|
||||
/// in fullscreen.
|
||||
///
|
||||
/// See [property@ToolbarView:reveal-bottom-bars].
|
||||
/// See ``revealBottomBars(_:)``.
|
||||
public func revealTopBars(_ revealTopBars: Bool? = true) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.revealTopBars = revealTopBars
|
||||
@ -396,10 +294,10 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
|
||||
/// The current top bar height.
|
||||
///
|
||||
/// Top bar height does change depending [property@ToolbarView:reveal-top-bars],
|
||||
/// Top bar height does change depending ``revealTopBars(_:)``,
|
||||
/// including during the transition.
|
||||
///
|
||||
/// See [property@ToolbarView:bottom-bar-height].
|
||||
/// See ``bottomBarHeight(_:)``.
|
||||
public func topBarHeight(_ topBarHeight: Int?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.topBarHeight = topBarHeight
|
||||
@ -410,26 +308,7 @@ public struct ToolbarView: AdwaitaWidget {
|
||||
///
|
||||
/// If set to `ADW_TOOLBAR_FLAT`, top bars are flat and scrolling content has a
|
||||
/// subtle undershoot shadow when touching them, same as the
|
||||
/// [`.undershoot-top`](style-classes.html#undershoot-indicators)
|
||||
/// style class. This works well for simple content, e.g. [class@StatusPage] or
|
||||
/// [class@PreferencesPage], where the background at the top of the page is
|
||||
/// uniform. Additionally, windows with sidebars should always use this style.
|
||||
///
|
||||
/// Undershoot shadow is only present if a top bar is actually present and
|
||||
/// visible. It is also never present if
|
||||
/// [property@ToolbarView:extend-content-to-top-edge] is set to `TRUE`.
|
||||
///
|
||||
/// If set to `ADW_TOOLBAR_RAISED`, top bars have an opaque background and a
|
||||
/// persistent shadow, this is suitable for content such as
|
||||
/// [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
|
||||
/// where some elements are directly adjacent to the top bars, or
|
||||
/// [class@TabView], where each page can have a different background.
|
||||
///
|
||||
/// `ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the
|
||||
/// shadow is replaced with a more subtle border. This can be useful for
|
||||
/// applications like image viewers.
|
||||
///
|
||||
/// See also [property@ToolbarView:bottom-bar-style].
|
||||
/// [`.undershoot-top`](style-classes.html
|
||||
public func topBarStyle(_ topBarStyle: ToolbarStyle?) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.topBarStyle = topBarStyle
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// WindowTitle.swift
|
||||
// Adwaita
|
||||
//
|
||||
// Created by auto-generation on 23.10.25.
|
||||
// Created by auto-generation on 30.10.25.
|
||||
//
|
||||
|
||||
import CAdw
|
||||
@ -10,14 +10,12 @@ import LevenshteinTransformations
|
||||
|
||||
/// A helper widget for setting a window's title and subtitle.
|
||||
///
|
||||
/// <picture><source srcset="window-title-dark.png" media="(prefers-color-scheme: dark)"><img src="window-title.png" alt="window-title"></picture>
|
||||
///
|
||||
///
|
||||
/// `AdwWindowTitle` shows a title and subtitle. It's intended to be used as the
|
||||
/// title child of [class@Gtk.HeaderBar] or [class@HeaderBar].
|
||||
/// title child of `Gtk.HeaderBar` or `HeaderBar`.
|
||||
///
|
||||
/// ## CSS nodes
|
||||
///
|
||||
/// `AdwWindowTitle` has a single CSS node with name `windowtitle`.
|
||||
public struct WindowTitle: AdwaitaWidget {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -30,10 +30,13 @@ extension String: @retroactive CodingKey {
|
||||
}
|
||||
|
||||
/// Generate a doc comment out of the string.
|
||||
/// - Parameter indent: Indentation added at the beginning of every line.
|
||||
/// - Parameters:
|
||||
/// - configuration: The generation configuration.
|
||||
/// - indent: Indentation added at the beginning of every line.
|
||||
/// - Returns: The comment.
|
||||
func docComment(indent: String = "") -> String {
|
||||
split(separator: "\n", omittingEmptySubsequences: false)
|
||||
func docComment(configuration: GenerationConfiguration, indent: String = "") -> String {
|
||||
applyDocRegex(configuration: configuration)
|
||||
.split(separator: "\n", omittingEmptySubsequences: false)
|
||||
.map { $0.trimmingCharacters(in: .whitespaces) }
|
||||
.enumerated()
|
||||
.map { $0.offset == 0 ? $0.element.prefix(1).capitalized + $0.element.dropFirst() : $0.element }
|
||||
@ -77,4 +80,84 @@ extension String: @retroactive CodingKey {
|
||||
return type
|
||||
}
|
||||
|
||||
/// Apply the documentation regex.
|
||||
/// - Parameter configuration: The generation configuration.
|
||||
/// - Returns: The documentation with the regex applied.
|
||||
func applyDocRegex(configuration: GenerationConfiguration) -> String {
|
||||
var modified = self
|
||||
do {
|
||||
modified = try modified.applyExtraContentRegex()
|
||||
modified = try modified.applySimpleRegex()
|
||||
modified = try modified.applyPropertyRegex(configuration: configuration)
|
||||
modified = try modified.applyBooleanRegex()
|
||||
modified = try modified.applyHTMLRegex()
|
||||
modified = try modified.applyNoteRegex()
|
||||
return modified
|
||||
} catch {
|
||||
print("FAIL!")
|
||||
return modified
|
||||
}
|
||||
}
|
||||
|
||||
/// Apply the regex to remove additional documentation content.
|
||||
/// - Returns: The documentation with the regex applied.
|
||||
func applyExtraContentRegex() throws -> String {
|
||||
let extraContent = try Regex("##?(.|\\n)*")
|
||||
return replacing(extraContent, with: "")
|
||||
}
|
||||
|
||||
/// Translate simple definitions into Markdown inline code.
|
||||
/// - Returns: The documentation with the regex applied.
|
||||
func applySimpleRegex() throws -> String {
|
||||
let regex = try Regex("\\[(class|func|method|ctor|signal|const|iface)@(.*?)\\]")
|
||||
return replacing(regex) { match in
|
||||
"`\(match.output[2].substring ?? "")`"
|
||||
}
|
||||
}
|
||||
|
||||
/// Translate property definitions into Swift references.
|
||||
/// - Parameter configuration: The generation configuration.
|
||||
/// - Returns: The documentation with the regex applied.
|
||||
func applyPropertyRegex(configuration: GenerationConfiguration) throws -> String {
|
||||
let property = try Regex("\\[property@(.*?)\\:(.*?)\\]")
|
||||
return replacing(property) { match in
|
||||
let method = String(match.output[2].substring ?? "")
|
||||
.convertDelimitedCasingToCamel(delimiter: "-", configuration: configuration, unshorten: true)
|
||||
return "``\(method)(_:)``"
|
||||
}
|
||||
}
|
||||
|
||||
/// Translate booleans into inline Markdown code with Swift booleans.
|
||||
/// - Returns: The documentation with the regex applied.
|
||||
func applyBooleanRegex() throws -> String {
|
||||
var modified = self
|
||||
let `false` = try Regex("(`|%)FALSE`?")
|
||||
modified = modified.replacing(`false`, with: "`false`")
|
||||
let `true` = try Regex("(`|%)TRUE`?")
|
||||
modified = modified.replacing(`true`, with: "`true`")
|
||||
return modified
|
||||
}
|
||||
|
||||
/// Remove broken HTML tags.
|
||||
/// - Returns: The documentation with the regex applied.
|
||||
func applyHTMLRegex() throws -> String {
|
||||
let picture = try Regex("<picture>.*?</picture>")
|
||||
return replacing(picture, with: "")
|
||||
}
|
||||
|
||||
/// Interpret note/warning blocks.
|
||||
/// - Returns: The documentation with the regex applied.
|
||||
func applyNoteRegex() throws -> String {
|
||||
var modified = self
|
||||
let note = try Regex("::: note\\n((.|\\n)*?)(\\n\\n)?")
|
||||
modified = modified.replacing(note) { match in
|
||||
"> [!NOTE]\n> \(match.output[1].substring ?? "")"
|
||||
}
|
||||
let warning = try Regex("::: warning\\n((.|\\n)*?)(\\n\\n)?")
|
||||
modified = modified.replacing(warning) { match in
|
||||
"> [!WARNING]\n> \(match.output[1].substring ?? "")"
|
||||
}
|
||||
return modified
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ struct Class: ClassLike, Decodable {
|
||||
import CAdw
|
||||
import LevenshteinTransformations
|
||||
|
||||
\(doc.docComment())
|
||||
\(doc.docComment(configuration: genConfig))
|
||||
public struct \(definition) {
|
||||
|
||||
/// Additional update functions for type extensions.
|
||||
|
||||
@ -74,7 +74,7 @@ struct Property: Decodable {
|
||||
func generate(config: WidgetConfiguration, genConfig: GenerationConfiguration) -> String {
|
||||
"""
|
||||
|
||||
\(doc?.docComment(indent: " ") ?? "/// \(name)")
|
||||
\(doc?.docComment(configuration: genConfig, indent: " ") ?? "/// \(name)")
|
||||
var \(parameter(config: config, genConfig: genConfig))
|
||||
"""
|
||||
}
|
||||
@ -91,7 +91,7 @@ struct Property: Decodable {
|
||||
let mainParameter = parameter(config: config, genConfig: genConfig, modifier: true, defaultValue: true)
|
||||
return """
|
||||
|
||||
\(doc?.docComment(indent: " ") ?? "/// \(name)")
|
||||
\(doc?.docComment(configuration: genConfig, indent: " ") ?? "/// \(name)")
|
||||
public func \(convertPropertyName(configuration: genConfig))(\(builder)_ \(mainParameter)) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.\(property) = \(property)
|
||||
|
||||
@ -24,7 +24,7 @@ struct Signal: Decodable {
|
||||
let name = name.convertDelimitedCasingToCamel(delimiter: "-", configuration: genConfig, unshorten: true)
|
||||
return """
|
||||
|
||||
\(doc?.docComment(indent: " ") ?? " /// \(name)")
|
||||
\(doc?.docComment(configuration: genConfig, indent: " ") ?? " /// \(name)")
|
||||
var \(name): (() -> Void)?
|
||||
"""
|
||||
}
|
||||
@ -38,7 +38,7 @@ struct Signal: Decodable {
|
||||
let name = name.convertDelimitedCasingToCamel(delimiter: "-", configuration: genConfig, unshorten: true)
|
||||
return """
|
||||
|
||||
\(doc?.docComment(indent: " ") ?? " /// \(name)")
|
||||
\(doc?.docComment(configuration: genConfig, indent: " ") ?? " /// \(name)")
|
||||
public func \(name)(_ \(name): @escaping () -> Void) -> Self {
|
||||
var newSelf = self
|
||||
newSelf.\(name) = \(name)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"app-id": "io.github.AparokshaUI.Demo",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "48",
|
||||
"runtime-version": "49",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"sdk-extensions": [
|
||||
"org.freedesktop.Sdk.Extension.swift6"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user