diff --git a/Sources/Core/Model/AdwaitaApp.swift b/Sources/Core/Model/AdwaitaApp.swift index cd9fc74..5f04a1c 100644 --- a/Sources/Core/Model/AdwaitaApp.swift +++ b/Sources/Core/Model/AdwaitaApp.swift @@ -100,7 +100,9 @@ public class AdwaitaApp: AppStorage { g_action_map_add_action(.init(pointer), action) signals[id] = data } - gtk_application_set_accels_for_action(pointer, (window == nil ? "app." : "win.") + id, [shortcut].cArray) + let array = [shortcut].cArray + gtk_application_set_accels_for_action(pointer, (window == nil ? "app." : "win.") + id, array) + array?.deallocate() } /// Remove a keyboard shortcut from the application. diff --git a/Sources/Core/View/Dialogs/AboutDialog.swift b/Sources/Core/View/Dialogs/AboutDialog.swift index 92be150..885b076 100644 --- a/Sources/Core/View/Dialogs/AboutDialog.swift +++ b/Sources/Core/View/Dialogs/AboutDialog.swift @@ -86,7 +86,7 @@ public struct AboutDialog: AdwaitaWidget { type: Data.Type ) where Data: ViewRenderData { child.updateStorage(storage, data: data, updateProperties: updateProperties, type: type) - guard updateProperties, (storage.previousState as? Self)?.visible != visible else { + guard updateProperties else { return } if visible { diff --git a/Sources/Core/View/Generated/ActionRow.swift b/Sources/Core/View/Generated/ActionRow.swift index a65327f..51a9f11 100644 --- a/Sources/Core/View/Generated/ActionRow.swift +++ b/Sources/Core/View/Generated/ActionRow.swift @@ -2,7 +2,7 @@ // ActionRow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -40,10 +40,16 @@ import LevenshteinTransformations /// It contains subnodes `label.title` and `label.subtitle` representing /// respectively the title label and subtitle label. /// -/// `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. +/// ## 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. +/// +/// property-row +/// +/// 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. @@ -226,7 +232,6 @@ public struct ActionRow: AdwaitaWidget { public func activatableWidget(@ViewBuilder _ activatableWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.activatableWidget = activatableWidget - return newSelf } @@ -237,7 +242,6 @@ public struct ActionRow: AdwaitaWidget { public func subtitle(_ subtitle: String?) -> Self { var newSelf = self newSelf.subtitle = subtitle - return newSelf } @@ -248,7 +252,6 @@ public struct ActionRow: AdwaitaWidget { public func subtitleLines(_ subtitleLines: Int?) -> Self { var newSelf = self newSelf.subtitleLines = subtitleLines - return newSelf } @@ -258,7 +261,6 @@ public struct ActionRow: AdwaitaWidget { public func subtitleSelectable(_ subtitleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.subtitleSelectable = subtitleSelectable - return newSelf } @@ -269,7 +271,6 @@ public struct ActionRow: AdwaitaWidget { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -279,7 +280,6 @@ public struct ActionRow: AdwaitaWidget { public func titleLines(_ titleLines: Int?) -> Self { var newSelf = self newSelf.titleLines = titleLines - return newSelf } @@ -289,7 +289,6 @@ public struct ActionRow: AdwaitaWidget { public func titleSelectable(_ titleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.titleSelectable = titleSelectable - return newSelf } @@ -301,7 +300,6 @@ public struct ActionRow: AdwaitaWidget { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -309,7 +307,6 @@ public struct ActionRow: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/AspectFrame.swift b/Sources/Core/View/Generated/AspectFrame.swift index ae1d3de..6fa4ea3 100644 --- a/Sources/Core/View/Generated/AspectFrame.swift +++ b/Sources/Core/View/Generated/AspectFrame.swift @@ -2,7 +2,7 @@ // AspectFrame.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -15,7 +15,7 @@ import LevenshteinTransformations /// /// # CSS nodes /// -/// `GtkAspectFrame` uses a CSS node with name `frame`. +/// `GtkAspectFrame` uses a CSS node with name `aspectframe`. /// /// # Accessibility /// @@ -112,7 +112,6 @@ public struct AspectFrame: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -120,7 +119,6 @@ public struct AspectFrame: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -128,7 +126,6 @@ public struct AspectFrame: AdwaitaWidget { public func obeyChild(_ obeyChild: Bool? = true) -> Self { var newSelf = self newSelf.obeyChild = obeyChild - return newSelf } @@ -139,7 +136,6 @@ public struct AspectFrame: AdwaitaWidget { public func ratio(_ ratio: Float) -> Self { var newSelf = self newSelf.ratio = ratio - return newSelf } @@ -147,7 +143,6 @@ public struct AspectFrame: AdwaitaWidget { public func xalign(_ xalign: Float?) -> Self { var newSelf = self newSelf.xalign = xalign - return newSelf } @@ -155,7 +150,6 @@ public struct AspectFrame: AdwaitaWidget { public func yalign(_ yalign: Float?) -> Self { var newSelf = self newSelf.yalign = yalign - return newSelf } diff --git a/Sources/Core/View/Generated/Avatar.swift b/Sources/Core/View/Generated/Avatar.swift index 216bcc3..bdf1e83 100644 --- a/Sources/Core/View/Generated/Avatar.swift +++ b/Sources/Core/View/Generated/Avatar.swift @@ -2,7 +2,7 @@ // Avatar.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -110,7 +110,6 @@ public struct Avatar: AdwaitaWidget { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -120,7 +119,6 @@ public struct Avatar: AdwaitaWidget { public func showInitials(_ showInitials: Bool) -> Self { var newSelf = self newSelf.showInitials = showInitials - return newSelf } @@ -128,7 +126,6 @@ public struct Avatar: AdwaitaWidget { public func size(_ size: Int) -> Self { var newSelf = self newSelf.size = size - return newSelf } @@ -139,7 +136,6 @@ public struct Avatar: AdwaitaWidget { public func text(_ text: String?) -> Self { var newSelf = self newSelf.text = text - return newSelf } diff --git a/Sources/Core/View/Generated/Banner.swift b/Sources/Core/View/Generated/Banner.swift index 4edb047..4ce235b 100644 --- a/Sources/Core/View/Generated/Banner.swift +++ b/Sources/Core/View/Generated/Banner.swift @@ -2,7 +2,7 @@ // Banner.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -122,7 +122,6 @@ public struct Banner: AdwaitaWidget { public func buttonLabel(_ buttonLabel: String?) -> Self { var newSelf = self newSelf.buttonLabel = buttonLabel - return newSelf } @@ -130,7 +129,6 @@ public struct Banner: AdwaitaWidget { public func revealed(_ revealed: Bool? = true) -> Self { var newSelf = self newSelf.revealed = revealed - return newSelf } @@ -140,7 +138,6 @@ public struct Banner: AdwaitaWidget { public func title(_ title: String) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -150,7 +147,6 @@ public struct Banner: AdwaitaWidget { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } diff --git a/Sources/Core/View/Generated/Bin.swift b/Sources/Core/View/Generated/Bin.swift index d1260e6..779346f 100644 --- a/Sources/Core/View/Generated/Bin.swift +++ b/Sources/Core/View/Generated/Bin.swift @@ -2,7 +2,7 @@ // Bin.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -77,7 +77,6 @@ public struct Bin: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } diff --git a/Sources/Core/View/Generated/Box.swift b/Sources/Core/View/Generated/Box.swift index 55db63c..c8b3687 100644 --- a/Sources/Core/View/Generated/Box.swift +++ b/Sources/Core/View/Generated/Box.swift @@ -2,7 +2,7 @@ // Box.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -155,7 +155,6 @@ public struct Box: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -163,7 +162,6 @@ public struct Box: AdwaitaWidget { public func baselineChild(_ baselineChild: Int?) -> Self { var newSelf = self newSelf.baselineChild = baselineChild - return newSelf } @@ -171,7 +169,6 @@ public struct Box: AdwaitaWidget { public func homogeneous(_ homogeneous: Bool? = true) -> Self { var newSelf = self newSelf.homogeneous = homogeneous - return newSelf } @@ -179,7 +176,6 @@ public struct Box: AdwaitaWidget { public func spacing(_ spacing: Int) -> Self { var newSelf = self newSelf.spacing = spacing - return newSelf } diff --git a/Sources/Core/View/Generated/Button.swift b/Sources/Core/View/Generated/Button.swift index fb7d714..232c822 100644 --- a/Sources/Core/View/Generated/Button.swift +++ b/Sources/Core/View/Generated/Button.swift @@ -2,7 +2,7 @@ // Button.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -17,6 +17,12 @@ import LevenshteinTransformations /// 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 @@ -49,7 +55,7 @@ public struct Button: AdwaitaWidget { /// /// The accessible role cannot be changed once set. var accessibleRole: String? -/// action-name + /// The name of the action with which this widget should be associated. var actionName: String? /// Whether the size of the button can be made smaller than the natural /// size of its contents. @@ -161,15 +167,13 @@ public struct Button: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } -/// action-name + /// The name of the action with which this widget should be associated. public func actionName(_ actionName: String?) -> Self { var newSelf = self newSelf.actionName = actionName - return newSelf } @@ -183,7 +187,6 @@ public struct Button: AdwaitaWidget { public func canShrink(_ canShrink: Bool? = true) -> Self { var newSelf = self newSelf.canShrink = canShrink - return newSelf } @@ -191,7 +194,6 @@ public struct Button: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -199,7 +201,6 @@ public struct Button: AdwaitaWidget { public func hasFrame(_ hasFrame: Bool? = true) -> Self { var newSelf = self newSelf.hasFrame = hasFrame - return newSelf } @@ -207,7 +208,6 @@ public struct Button: AdwaitaWidget { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -215,7 +215,6 @@ public struct Button: AdwaitaWidget { public func label(_ label: String?) -> Self { var newSelf = self newSelf.label = label - return newSelf } @@ -224,7 +223,6 @@ public struct Button: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/ButtonContent.swift b/Sources/Core/View/Generated/ButtonContent.swift index eeb7aeb..5159d9e 100644 --- a/Sources/Core/View/Generated/ButtonContent.swift +++ b/Sources/Core/View/Generated/ButtonContent.swift @@ -2,7 +2,7 @@ // ButtonContent.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -129,7 +129,6 @@ public struct ButtonContent: AdwaitaWidget { public func canShrink(_ canShrink: Bool? = true) -> Self { var newSelf = self newSelf.canShrink = canShrink - return newSelf } @@ -139,7 +138,6 @@ public struct ButtonContent: AdwaitaWidget { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -147,7 +145,6 @@ public struct ButtonContent: AdwaitaWidget { public func label(_ label: String?) -> Self { var newSelf = self newSelf.label = label - return newSelf } @@ -159,7 +156,6 @@ public struct ButtonContent: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/Carousel.swift b/Sources/Core/View/Generated/Carousel.swift index e0b3223..a67d0b0 100644 --- a/Sources/Core/View/Generated/Carousel.swift +++ b/Sources/Core/View/Generated/Carousel.swift @@ -2,7 +2,7 @@ // Carousel.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -159,7 +159,6 @@ public struct Carousel: AdwaitaWidget where Element: Identifiable { public func allowLongSwipes(_ allowLongSwipes: Bool? = true) -> Self { var newSelf = self newSelf.allowLongSwipes = allowLongSwipes - return newSelf } @@ -169,7 +168,6 @@ public struct Carousel: AdwaitaWidget where Element: Identifiable { public func allowMouseDrag(_ allowMouseDrag: Bool? = true) -> Self { var newSelf = self newSelf.allowMouseDrag = allowMouseDrag - return newSelf } @@ -179,7 +177,6 @@ public struct Carousel: AdwaitaWidget where Element: Identifiable { public func allowScrollWheel(_ allowScrollWheel: Bool? = true) -> Self { var newSelf = self newSelf.allowScrollWheel = allowScrollWheel - return newSelf } @@ -190,7 +187,6 @@ public struct Carousel: AdwaitaWidget where Element: Identifiable { public func interactive(_ interactive: Bool? = true) -> Self { var newSelf = self newSelf.interactive = interactive - return newSelf } @@ -198,7 +194,6 @@ public struct Carousel: AdwaitaWidget where Element: Identifiable { public func nPages(_ nPages: UInt?) -> Self { var newSelf = self newSelf.nPages = nPages - return newSelf } @@ -208,7 +203,6 @@ public struct Carousel: AdwaitaWidget where Element: Identifiable { public func revealDuration(_ revealDuration: UInt?) -> Self { var newSelf = self newSelf.revealDuration = revealDuration - return newSelf } @@ -216,7 +210,6 @@ public struct Carousel: AdwaitaWidget where Element: Identifiable { public func spacing(_ spacing: UInt?) -> Self { var newSelf = self newSelf.spacing = spacing - return newSelf } diff --git a/Sources/Core/View/Generated/CenterBox.swift b/Sources/Core/View/Generated/CenterBox.swift index bb7256c..73c2396 100644 --- a/Sources/Core/View/Generated/CenterBox.swift +++ b/Sources/Core/View/Generated/CenterBox.swift @@ -2,7 +2,7 @@ // CenterBox.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -146,7 +146,6 @@ public struct CenterBox: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -154,7 +153,6 @@ public struct CenterBox: AdwaitaWidget { public func centerWidget(@ViewBuilder _ centerWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.centerWidget = centerWidget - return newSelf } @@ -166,7 +164,6 @@ public struct CenterBox: AdwaitaWidget { public func endWidget(@ViewBuilder _ endWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.endWidget = endWidget - return newSelf } @@ -181,7 +178,6 @@ public struct CenterBox: AdwaitaWidget { public func shrinkCenterLast(_ shrinkCenterLast: Bool? = true) -> Self { var newSelf = self newSelf.shrinkCenterLast = shrinkCenterLast - return newSelf } @@ -193,7 +189,6 @@ public struct CenterBox: AdwaitaWidget { public func startWidget(@ViewBuilder _ startWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.startWidget = startWidget - return newSelf } diff --git a/Sources/Core/View/Generated/CheckButton.swift b/Sources/Core/View/Generated/CheckButton.swift index 1a50b23..db19dde 100644 --- a/Sources/Core/View/Generated/CheckButton.swift +++ b/Sources/Core/View/Generated/CheckButton.swift @@ -2,7 +2,7 @@ // CheckButton.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -48,10 +48,16 @@ import LevenshteinTransformations /// `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: +/// +/// - or Enter activates the button. +/// /// # CSS nodes /// /// ``` -/// checkbutton[.text-button] +/// checkbutton[.text-button][.grouped] /// ├── check /// ╰── [label] /// ``` @@ -76,7 +82,7 @@ public struct CheckButton: AdwaitaWidget { /// /// The accessible role cannot be changed once set. var accessibleRole: String? -/// action-name + /// The name of the action with which this widget should be associated. var actionName: String? /// If the check button is active. /// @@ -193,15 +199,13 @@ if let active, newValue != active.wrappedValue { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } -/// action-name + /// The name of the action with which this widget should be associated. public func actionName(_ actionName: String?) -> Self { var newSelf = self newSelf.actionName = actionName - return newSelf } @@ -212,7 +216,6 @@ if let active, newValue != active.wrappedValue { public func active(_ active: Binding?) -> Self { var newSelf = self newSelf.active = active - return newSelf } @@ -220,7 +223,6 @@ if let active, newValue != active.wrappedValue { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -231,7 +233,6 @@ if let active, newValue != active.wrappedValue { public func inconsistent(_ inconsistent: Bool? = true) -> Self { var newSelf = self newSelf.inconsistent = inconsistent - return newSelf } @@ -239,7 +240,6 @@ if let active, newValue != active.wrappedValue { public func label(_ label: String?) -> Self { var newSelf = self newSelf.label = label - return newSelf } @@ -248,7 +248,6 @@ if let active, newValue != active.wrappedValue { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/Clamp.swift b/Sources/Core/View/Generated/Clamp.swift index 0ec14ce..d64b2b3 100644 --- a/Sources/Core/View/Generated/Clamp.swift +++ b/Sources/Core/View/Generated/Clamp.swift @@ -2,7 +2,7 @@ // Clamp.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -21,7 +21,9 @@ import LevenshteinTransformations /// allocated the minimum size it can fit in instead. /// /// `AdwClamp` can scale with the text scale factor, use the -/// [property@ClampLayout:unit] property to enable that behavior. +/// [property@Clamp:unit] property to enable that behavior. +/// +/// See also: [class@ClampLayout], [class@ClampScrollable]. /// /// ## CSS nodes /// @@ -111,7 +113,6 @@ public struct Clamp: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -121,7 +122,6 @@ public struct Clamp: AdwaitaWidget { public func maximumSize(_ maximumSize: Int?) -> Self { var newSelf = self newSelf.maximumSize = maximumSize - return newSelf } @@ -142,7 +142,6 @@ public struct Clamp: AdwaitaWidget { public func tighteningThreshold(_ tighteningThreshold: Int?) -> Self { var newSelf = self newSelf.tighteningThreshold = tighteningThreshold - return newSelf } diff --git a/Sources/Core/View/Generated/ComboRow.swift b/Sources/Core/View/Generated/ComboRow.swift index 6161245..6b6345a 100644 --- a/Sources/Core/View/Generated/ComboRow.swift +++ b/Sources/Core/View/Generated/ComboRow.swift @@ -2,7 +2,7 @@ // ComboRow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -236,7 +236,6 @@ if let selected, newValue != selected.wrappedValue { public func activatableWidget(@ViewBuilder _ activatableWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.activatableWidget = activatableWidget - return newSelf } @@ -249,7 +248,6 @@ if let selected, newValue != selected.wrappedValue { public func enableSearch(_ enableSearch: Bool? = true) -> Self { var newSelf = self newSelf.enableSearch = enableSearch - return newSelf } @@ -260,7 +258,6 @@ if let selected, newValue != selected.wrappedValue { public func selected(_ selected: Binding?) -> Self { var newSelf = self newSelf.selected = selected - return newSelf } @@ -271,7 +268,6 @@ if let selected, newValue != selected.wrappedValue { public func subtitle(_ subtitle: String?) -> Self { var newSelf = self newSelf.subtitle = subtitle - return newSelf } @@ -282,7 +278,6 @@ if let selected, newValue != selected.wrappedValue { public func subtitleLines(_ subtitleLines: Int?) -> Self { var newSelf = self newSelf.subtitleLines = subtitleLines - return newSelf } @@ -292,7 +287,6 @@ if let selected, newValue != selected.wrappedValue { public func subtitleSelectable(_ subtitleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.subtitleSelectable = subtitleSelectable - return newSelf } @@ -303,7 +297,6 @@ if let selected, newValue != selected.wrappedValue { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -313,7 +306,6 @@ if let selected, newValue != selected.wrappedValue { public func titleLines(_ titleLines: Int?) -> Self { var newSelf = self newSelf.titleLines = titleLines - return newSelf } @@ -323,7 +315,6 @@ if let selected, newValue != selected.wrappedValue { public func titleSelectable(_ titleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.titleSelectable = titleSelectable - return newSelf } @@ -335,7 +326,6 @@ if let selected, newValue != selected.wrappedValue { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -351,7 +341,6 @@ if let selected, newValue != selected.wrappedValue { public func useSubtitle(_ useSubtitle: Bool? = true) -> Self { var newSelf = self newSelf.useSubtitle = useSubtitle - return newSelf } @@ -359,7 +348,6 @@ if let selected, newValue != selected.wrappedValue { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/EntryRow.swift b/Sources/Core/View/Generated/EntryRow.swift index e5e18dd..ff7d1d6 100644 --- a/Sources/Core/View/Generated/EntryRow.swift +++ b/Sources/Core/View/Generated/EntryRow.swift @@ -2,7 +2,7 @@ // EntryRow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -52,6 +52,8 @@ public struct EntryRow: AdwaitaWidget { /// /// Emoji replacement is done with :-delimited names, like `:heart:`. var enableEmojiCompletion: Bool? + /// Maximum number of characters for the entry. + var maxLength: Int? /// Whether to show the apply button. /// /// When set to `TRUE`, typing text in the entry will reveal an apply button. @@ -148,6 +150,9 @@ public struct EntryRow: AdwaitaWidget { if let enableEmojiCompletion, updateProperties, (storage.previousState as? Self)?.enableEmojiCompletion != enableEmojiCompletion { adw_entry_row_set_enable_emoji_completion(widget?.cast(), enableEmojiCompletion.cBool) } + if let maxLength, updateProperties, (storage.previousState as? Self)?.maxLength != maxLength { + adw_entry_row_set_max_length(widget?.cast(), maxLength.cInt) + } if let showApplyButton, updateProperties, (storage.previousState as? Self)?.showApplyButton != showApplyButton { adw_entry_row_set_show_apply_button(widget?.cast(), showApplyButton.cBool) } @@ -202,7 +207,6 @@ public struct EntryRow: AdwaitaWidget { public func activatesDefault(_ activatesDefault: Bool? = true) -> Self { var newSelf = self newSelf.activatesDefault = activatesDefault - return newSelf } @@ -212,7 +216,13 @@ public struct EntryRow: AdwaitaWidget { public func enableEmojiCompletion(_ enableEmojiCompletion: Bool? = true) -> Self { var newSelf = self newSelf.enableEmojiCompletion = enableEmojiCompletion - + return newSelf + } + + /// Maximum number of characters for the entry. + public func maxLength(_ maxLength: Int?) -> Self { + var newSelf = self + newSelf.maxLength = maxLength return newSelf } @@ -228,7 +238,6 @@ public struct EntryRow: AdwaitaWidget { public func showApplyButton(_ showApplyButton: Bool? = true) -> Self { var newSelf = self newSelf.showApplyButton = showApplyButton - return newSelf } @@ -236,7 +245,6 @@ public struct EntryRow: AdwaitaWidget { public func textLength(_ textLength: UInt?) -> Self { var newSelf = self newSelf.textLength = textLength - return newSelf } @@ -247,7 +255,6 @@ public struct EntryRow: AdwaitaWidget { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -257,7 +264,6 @@ public struct EntryRow: AdwaitaWidget { public func titleSelectable(_ titleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.titleSelectable = titleSelectable - return newSelf } @@ -269,7 +275,6 @@ public struct EntryRow: AdwaitaWidget { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -277,7 +282,6 @@ public struct EntryRow: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/ExpanderRow.swift b/Sources/Core/View/Generated/ExpanderRow.swift index c2ff260..e8090c7 100644 --- a/Sources/Core/View/Generated/ExpanderRow.swift +++ b/Sources/Core/View/Generated/ExpanderRow.swift @@ -2,7 +2,7 @@ // ExpanderRow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -33,6 +33,15 @@ import LevenshteinTransformations /// 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. @@ -223,7 +232,6 @@ if let expanded, newValue != expanded.wrappedValue { public func enableExpansion(_ enableExpansion: Binding?) -> Self { var newSelf = self newSelf.enableExpansion = enableExpansion - return newSelf } @@ -231,7 +239,6 @@ if let expanded, newValue != expanded.wrappedValue { public func expanded(_ expanded: Binding?) -> Self { var newSelf = self newSelf.expanded = expanded - return newSelf } @@ -239,7 +246,6 @@ if let expanded, newValue != expanded.wrappedValue { public func showEnableSwitch(_ showEnableSwitch: Bool? = true) -> Self { var newSelf = self newSelf.showEnableSwitch = showEnableSwitch - return newSelf } @@ -250,7 +256,6 @@ if let expanded, newValue != expanded.wrappedValue { public func subtitle(_ subtitle: String?) -> Self { var newSelf = self newSelf.subtitle = subtitle - return newSelf } @@ -261,7 +266,6 @@ if let expanded, newValue != expanded.wrappedValue { public func subtitleLines(_ subtitleLines: Int?) -> Self { var newSelf = self newSelf.subtitleLines = subtitleLines - return newSelf } @@ -272,7 +276,6 @@ if let expanded, newValue != expanded.wrappedValue { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -282,7 +285,6 @@ if let expanded, newValue != expanded.wrappedValue { public func titleLines(_ titleLines: Int?) -> Self { var newSelf = self newSelf.titleLines = titleLines - return newSelf } @@ -292,7 +294,6 @@ if let expanded, newValue != expanded.wrappedValue { public func titleSelectable(_ titleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.titleSelectable = titleSelectable - return newSelf } @@ -304,7 +305,6 @@ if let expanded, newValue != expanded.wrappedValue { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -312,7 +312,6 @@ if let expanded, newValue != expanded.wrappedValue { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/Fixed.swift b/Sources/Core/View/Generated/Fixed.swift index f02c9d7..3a0a41c 100644 --- a/Sources/Core/View/Generated/Fixed.swift +++ b/Sources/Core/View/Generated/Fixed.swift @@ -2,7 +2,7 @@ // Fixed.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -102,7 +102,6 @@ public struct Fixed: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } diff --git a/Sources/Core/View/Generated/FlowBox.swift b/Sources/Core/View/Generated/FlowBox.swift index a366829..f175ee2 100644 --- a/Sources/Core/View/Generated/FlowBox.swift +++ b/Sources/Core/View/Generated/FlowBox.swift @@ -2,7 +2,7 @@ // FlowBox.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -34,6 +34,15 @@ import LevenshteinTransformations /// /// Also see [class@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 /// /// ``` @@ -59,7 +68,7 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { /// Additional appear functions for type extensions. var appearFunctions: [(ViewStorage, WidgetData) -> Void] = [] -/// accept-unpaired-release + /// Whether to accept unpaired release events. var acceptUnpairedRelease: Bool? /// The accessible role of the given `GtkAccessible` implementation. /// @@ -256,11 +265,10 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { } } -/// accept-unpaired-release + /// Whether to accept unpaired release events. public func acceptUnpairedRelease(_ acceptUnpairedRelease: Bool? = true) -> Self { var newSelf = self newSelf.acceptUnpairedRelease = acceptUnpairedRelease - return newSelf } @@ -270,7 +278,6 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -279,7 +286,6 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { public func activateOnSingleClick(_ activateOnSingleClick: Bool? = true) -> Self { var newSelf = self newSelf.activateOnSingleClick = activateOnSingleClick - return newSelf } @@ -287,7 +293,6 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { public func columnSpacing(_ columnSpacing: UInt?) -> Self { var newSelf = self newSelf.columnSpacing = columnSpacing - return newSelf } @@ -296,7 +301,6 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { public func homogeneous(_ homogeneous: Bool? = true) -> Self { var newSelf = self newSelf.homogeneous = homogeneous - return newSelf } @@ -305,7 +309,6 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { public func maxChildrenPerLine(_ maxChildrenPerLine: UInt?) -> Self { var newSelf = self newSelf.maxChildrenPerLine = maxChildrenPerLine - return newSelf } @@ -318,7 +321,6 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { public func minChildrenPerLine(_ minChildrenPerLine: UInt?) -> Self { var newSelf = self newSelf.minChildrenPerLine = minChildrenPerLine - return newSelf } @@ -326,7 +328,6 @@ public struct FlowBox: AdwaitaWidget where Element: Identifiable { public func rowSpacing(_ rowSpacing: UInt?) -> Self { var newSelf = self newSelf.rowSpacing = rowSpacing - return newSelf } diff --git a/Sources/Core/View/Generated/HeaderBar.swift b/Sources/Core/View/Generated/HeaderBar.swift index a95c843..8c7cb95 100644 --- a/Sources/Core/View/Generated/HeaderBar.swift +++ b/Sources/Core/View/Generated/HeaderBar.swift @@ -2,7 +2,7 @@ // HeaderBar.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -19,7 +19,7 @@ import LevenshteinTransformations /// ## Dialog Integration /// /// When placed inside an [class@Dialog], `AdwHeaderBar` will display the dialog -/// title intead of window title. It will also adjust the decoration layout to +/// 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 @@ -44,6 +44,13 @@ import LevenshteinTransformations /// `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 @@ -265,7 +272,6 @@ public struct HeaderBar: AdwaitaWidget { public func decorationLayout(_ decorationLayout: String?) -> Self { var newSelf = self newSelf.decorationLayout = decorationLayout - return newSelf } @@ -276,7 +282,6 @@ public struct HeaderBar: AdwaitaWidget { public func showBackButton(_ showBackButton: Bool? = true) -> Self { var newSelf = self newSelf.showBackButton = showBackButton - return newSelf } @@ -291,7 +296,6 @@ public struct HeaderBar: AdwaitaWidget { public func showEndTitleButtons(_ showEndTitleButtons: Bool? = true) -> Self { var newSelf = self newSelf.showEndTitleButtons = showEndTitleButtons - return newSelf } @@ -306,7 +310,6 @@ public struct HeaderBar: AdwaitaWidget { public func showStartTitleButtons(_ showStartTitleButtons: Bool? = true) -> Self { var newSelf = self newSelf.showStartTitleButtons = showStartTitleButtons - return newSelf } @@ -314,7 +317,6 @@ public struct HeaderBar: AdwaitaWidget { public func showTitle(_ showTitle: Bool? = true) -> Self { var newSelf = self newSelf.showTitle = showTitle - return newSelf } @@ -331,7 +333,6 @@ public struct HeaderBar: AdwaitaWidget { public func titleWidget(@ViewBuilder _ titleWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.titleWidget = titleWidget - return newSelf } diff --git a/Sources/Core/View/Generated/Label.swift b/Sources/Core/View/Generated/Label.swift index 3052784..ebb1ea8 100644 --- a/Sources/Core/View/Generated/Label.swift +++ b/Sources/Core/View/Generated/Label.swift @@ -2,7 +2,7 @@ // Label.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -15,6 +15,40 @@ import LevenshteinTransformations /// /// ![An example GtkLabel](label.png) /// +/// ## Shortcuts and Gestures +/// +/// `GtkLabel` supports the following keyboard shortcuts, when the cursor is +/// visible: +/// +/// - Shift+F10 or Menu opens the context menu. +/// - Ctrl+A or Ctrl+/ +/// selects all. +/// - Ctrl+Shift+A or +/// Ctrl+\ 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 /// /// ``` @@ -360,7 +394,6 @@ public struct Label: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -379,7 +412,6 @@ public struct Label: AdwaitaWidget { public func label(_ label: String) -> Self { var newSelf = self newSelf.label = label - return newSelf } @@ -391,7 +423,6 @@ public struct Label: AdwaitaWidget { public func lines(_ lines: Int?) -> Self { var newSelf = self newSelf.lines = lines - return newSelf } @@ -405,7 +436,6 @@ public struct Label: AdwaitaWidget { public func maxWidthChars(_ maxWidthChars: Int?) -> Self { var newSelf = self newSelf.maxWidthChars = maxWidthChars - return newSelf } @@ -413,7 +443,6 @@ public struct Label: AdwaitaWidget { public func mnemonicKeyval(_ mnemonicKeyval: UInt?) -> Self { var newSelf = self newSelf.mnemonicKeyval = mnemonicKeyval - return newSelf } @@ -421,7 +450,6 @@ public struct Label: AdwaitaWidget { public func mnemonicWidget(@ViewBuilder _ mnemonicWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.mnemonicWidget = mnemonicWidget - return newSelf } @@ -429,7 +457,6 @@ public struct Label: AdwaitaWidget { public func selectable(_ selectable: Bool? = true) -> Self { var newSelf = self newSelf.selectable = selectable - return newSelf } @@ -442,7 +469,6 @@ public struct Label: AdwaitaWidget { public func singleLineMode(_ singleLineMode: Bool? = true) -> Self { var newSelf = self newSelf.singleLineMode = singleLineMode - return newSelf } @@ -452,7 +478,6 @@ public struct Label: AdwaitaWidget { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -461,7 +486,6 @@ public struct Label: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } @@ -475,7 +499,6 @@ public struct Label: AdwaitaWidget { public func widthChars(_ widthChars: Int?) -> Self { var newSelf = self newSelf.widthChars = widthChars - return newSelf } @@ -483,7 +506,6 @@ public struct Label: AdwaitaWidget { public func wrap(_ wrap: Bool? = true) -> Self { var newSelf = self newSelf.wrap = wrap - return newSelf } @@ -494,7 +516,6 @@ public struct Label: AdwaitaWidget { public func xalign(_ xalign: Float?) -> Self { var newSelf = self newSelf.xalign = xalign - return newSelf } @@ -505,7 +526,6 @@ public struct Label: AdwaitaWidget { public func yalign(_ yalign: Float?) -> Self { var newSelf = self newSelf.yalign = yalign - return newSelf } diff --git a/Sources/Core/View/Generated/LevelBar.swift b/Sources/Core/View/Generated/LevelBar.swift index bfe368a..75727d5 100644 --- a/Sources/Core/View/Generated/LevelBar.swift +++ b/Sources/Core/View/Generated/LevelBar.swift @@ -2,7 +2,7 @@ // LevelBar.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -199,7 +199,6 @@ public struct LevelBar: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -210,7 +209,6 @@ public struct LevelBar: AdwaitaWidget { public func inverted(_ inverted: Bool? = true) -> Self { var newSelf = self newSelf.inverted = inverted - return newSelf } @@ -218,7 +216,6 @@ public struct LevelBar: AdwaitaWidget { public func maxValue(_ maxValue: Double?) -> Self { var newSelf = self newSelf.maxValue = maxValue - return newSelf } @@ -226,7 +223,6 @@ public struct LevelBar: AdwaitaWidget { public func minValue(_ minValue: Double?) -> Self { var newSelf = self newSelf.minValue = minValue - return newSelf } @@ -234,7 +230,6 @@ public struct LevelBar: AdwaitaWidget { public func value(_ value: Double?) -> Self { var newSelf = self newSelf.value = value - return newSelf } diff --git a/Sources/Core/View/Generated/LinkButton.swift b/Sources/Core/View/Generated/LinkButton.swift index c4a86bd..3939d82 100644 --- a/Sources/Core/View/Generated/LinkButton.swift +++ b/Sources/Core/View/Generated/LinkButton.swift @@ -2,7 +2,7 @@ // LinkButton.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -26,6 +26,19 @@ import LevenshteinTransformations /// [signal@Gtk.LinkButton::activate-link] signal and returning %TRUE from /// the signal handler. /// +/// # Shortcuts and Gestures +/// +/// `GtkLinkButton` supports the following keyboard shortcuts: +/// +/// - Shift+F10 or Menu 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 @@ -45,7 +58,7 @@ public struct LinkButton: AdwaitaWidget { /// /// The accessible role cannot be changed once set. var accessibleRole: String? -/// action-name + /// The name of the action with which this widget should be associated. var actionName: String? /// Whether the size of the button can be made smaller than the natural /// size of its contents. @@ -170,15 +183,13 @@ public struct LinkButton: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } -/// action-name + /// The name of the action with which this widget should be associated. public func actionName(_ actionName: String?) -> Self { var newSelf = self newSelf.actionName = actionName - return newSelf } @@ -192,7 +203,6 @@ public struct LinkButton: AdwaitaWidget { public func canShrink(_ canShrink: Bool? = true) -> Self { var newSelf = self newSelf.canShrink = canShrink - return newSelf } @@ -200,7 +210,6 @@ public struct LinkButton: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -208,7 +217,6 @@ public struct LinkButton: AdwaitaWidget { public func hasFrame(_ hasFrame: Bool? = true) -> Self { var newSelf = self newSelf.hasFrame = hasFrame - return newSelf } @@ -216,7 +224,6 @@ public struct LinkButton: AdwaitaWidget { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -224,7 +231,6 @@ public struct LinkButton: AdwaitaWidget { public func label(_ label: String?) -> Self { var newSelf = self newSelf.label = label - return newSelf } @@ -232,7 +238,6 @@ public struct LinkButton: AdwaitaWidget { public func uri(_ uri: String) -> Self { var newSelf = self newSelf.uri = uri - return newSelf } @@ -241,7 +246,6 @@ public struct LinkButton: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } @@ -251,7 +255,6 @@ public struct LinkButton: AdwaitaWidget { public func visited(_ visited: Bool? = true) -> Self { var newSelf = self newSelf.visited = visited - return newSelf } diff --git a/Sources/Core/View/Generated/ListBox.swift b/Sources/Core/View/Generated/ListBox.swift index 113cdee..abc9589 100644 --- a/Sources/Core/View/Generated/ListBox.swift +++ b/Sources/Core/View/Generated/ListBox.swift @@ -2,7 +2,7 @@ // ListBox.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -38,6 +38,15 @@ import LevenshteinTransformations /// attribute of a `` 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 /// /// |[ @@ -79,9 +88,19 @@ public struct ListBox: AdwaitaWidget where Element: Identifiable { var activateOnSingleClick: Bool? /// Whether to show separators between rows. var showSeparators: Bool? - /// activateCursorRow + /// Emitted when the cursor row is activated. var activateCursorRow: (() -> Void)? - /// moveCursor + /// Emitted when the user initiates a cursor movement. + /// + /// The default bindings for this signal come in two variants, the variant with + /// the Shift modifier extends the selection, the variant without the Shift + /// modifier does not. There are too many key combinations to list them all + /// here. + /// + /// - , , , + /// move by individual children + /// - Home, End move to the ends of the box + /// - PgUp, PgDn move vertically by pages var moveCursor: (() -> Void)? /// Emitted when a row has been activated by the user. var rowActivated: (() -> Void)? @@ -101,7 +120,9 @@ public struct ListBox: AdwaitaWidget where Element: Identifiable { var selectAll: (() -> Void)? /// Emitted when the set of selected rows changes. var selectedRowsChanged: (() -> Void)? - /// toggleCursorRow + /// Emitted when the cursor row is toggled. + /// + /// The default bindings for this signal is Ctrl+. var toggleCursorRow: (() -> Void)? /// Emitted to unselect all children of the box, if the selection /// mode permits it. @@ -230,7 +251,6 @@ public struct ListBox: AdwaitaWidget where Element: Identifiable { public func acceptUnpairedRelease(_ acceptUnpairedRelease: Bool? = true) -> Self { var newSelf = self newSelf.acceptUnpairedRelease = acceptUnpairedRelease - return newSelf } @@ -240,7 +260,6 @@ public struct ListBox: AdwaitaWidget where Element: Identifiable { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -249,7 +268,6 @@ public struct ListBox: AdwaitaWidget where Element: Identifiable { public func activateOnSingleClick(_ activateOnSingleClick: Bool? = true) -> Self { var newSelf = self newSelf.activateOnSingleClick = activateOnSingleClick - return newSelf } @@ -257,18 +275,27 @@ public struct ListBox: AdwaitaWidget where Element: Identifiable { public func showSeparators(_ showSeparators: Bool? = true) -> Self { var newSelf = self newSelf.showSeparators = showSeparators - return newSelf } - /// activateCursorRow + /// Emitted when the cursor row is activated. public func activateCursorRow(_ activateCursorRow: @escaping () -> Void) -> Self { var newSelf = self newSelf.activateCursorRow = activateCursorRow return newSelf } - /// moveCursor + /// Emitted when the user initiates a cursor movement. + /// + /// The default bindings for this signal come in two variants, the variant with + /// the Shift modifier extends the selection, the variant without the Shift + /// modifier does not. There are too many key combinations to list them all + /// here. + /// + /// - , , , + /// move by individual children + /// - Home, End move to the ends of the box + /// - PgUp, PgDn move vertically by pages public func moveCursor(_ moveCursor: @escaping () -> Void) -> Self { var newSelf = self newSelf.moveCursor = moveCursor @@ -313,7 +340,9 @@ public struct ListBox: AdwaitaWidget where Element: Identifiable { return newSelf } - /// toggleCursorRow + /// Emitted when the cursor row is toggled. + /// + /// The default bindings for this signal is Ctrl+. public func toggleCursorRow(_ toggleCursorRow: @escaping () -> Void) -> Self { var newSelf = self newSelf.toggleCursorRow = toggleCursorRow diff --git a/Sources/Core/View/Generated/Menu.swift b/Sources/Core/View/Generated/Menu.swift index cd32afa..9df4adb 100644 --- a/Sources/Core/View/Generated/Menu.swift +++ b/Sources/Core/View/Generated/Menu.swift @@ -2,7 +2,7 @@ // Menu.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -208,7 +208,6 @@ if let active, newValue != active.wrappedValue { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -216,7 +215,6 @@ if let active, newValue != active.wrappedValue { public func active(_ active: Binding?) -> Self { var newSelf = self newSelf.active = active - return newSelf } @@ -224,7 +222,6 @@ if let active, newValue != active.wrappedValue { public func alwaysShowArrow(_ alwaysShowArrow: Bool? = true) -> Self { var newSelf = self newSelf.alwaysShowArrow = alwaysShowArrow - return newSelf } @@ -233,7 +230,6 @@ if let active, newValue != active.wrappedValue { public func canShrink(_ canShrink: Bool? = true) -> Self { var newSelf = self newSelf.canShrink = canShrink - return newSelf } @@ -241,7 +237,6 @@ if let active, newValue != active.wrappedValue { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -249,7 +244,6 @@ if let active, newValue != active.wrappedValue { public func hasFrame(_ hasFrame: Bool? = true) -> Self { var newSelf = self newSelf.hasFrame = hasFrame - return newSelf } @@ -257,7 +251,6 @@ if let active, newValue != active.wrappedValue { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -265,7 +258,6 @@ if let active, newValue != active.wrappedValue { public func label(_ label: String?) -> Self { var newSelf = self newSelf.label = label - return newSelf } @@ -276,7 +268,6 @@ if let active, newValue != active.wrappedValue { public func menuModel(@ViewBuilder _ menuModel: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.menuModel = menuModel - return newSelf } @@ -286,7 +277,6 @@ if let active, newValue != active.wrappedValue { public func primary(_ primary: Bool? = true) -> Self { var newSelf = self newSelf.primary = primary - return newSelf } @@ -294,7 +284,6 @@ if let active, newValue != active.wrappedValue { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/NavigationView.swift b/Sources/Core/View/Generated/NavigationView.swift index 22491b8..8095eee 100644 --- a/Sources/Core/View/Generated/NavigationView.swift +++ b/Sources/Core/View/Generated/NavigationView.swift @@ -2,7 +2,7 @@ // NavigationView.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -234,7 +234,6 @@ public struct NavigationView: AdwaitaWidget { public func animateTransitions(_ animateTransitions: Bool? = true) -> Self { var newSelf = self newSelf.animateTransitions = animateTransitions - return newSelf } @@ -245,7 +244,6 @@ public struct NavigationView: AdwaitaWidget { public func popOnEscape(_ popOnEscape: Bool? = true) -> Self { var newSelf = self newSelf.popOnEscape = popOnEscape - return newSelf } diff --git a/Sources/Core/View/Generated/Overlay.swift b/Sources/Core/View/Generated/Overlay.swift index 6a664a4..da2e74a 100644 --- a/Sources/Core/View/Generated/Overlay.swift +++ b/Sources/Core/View/Generated/Overlay.swift @@ -2,7 +2,7 @@ // Overlay.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -146,7 +146,6 @@ public struct Overlay: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -154,7 +153,6 @@ public struct Overlay: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } diff --git a/Sources/Core/View/Generated/OverlaySplitView.swift b/Sources/Core/View/Generated/OverlaySplitView.swift index cb486ca..cbe937c 100644 --- a/Sources/Core/View/Generated/OverlaySplitView.swift +++ b/Sources/Core/View/Generated/OverlaySplitView.swift @@ -2,7 +2,7 @@ // OverlaySplitView.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -40,7 +40,7 @@ import LevenshteinTransformations /// setting the `collapsed` property to `TRUE` on small widths, as follows: /// /// ```xml -/// 360200800800max-width: 400spTrue +/// 800800max-width: 400spTrue /// ``` /// /// `AdwOverlaySplitView` is often used for implementing the @@ -261,7 +261,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func collapsed(_ collapsed: Bool? = true) -> Self { var newSelf = self newSelf.collapsed = collapsed - return newSelf } @@ -269,7 +268,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func content(@ViewBuilder _ content: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.content = content - return newSelf } @@ -279,7 +277,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func enableHideGesture(_ enableHideGesture: Bool? = true) -> Self { var newSelf = self newSelf.enableHideGesture = enableHideGesture - return newSelf } @@ -289,7 +286,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func enableShowGesture(_ enableShowGesture: Bool? = true) -> Self { var newSelf = self newSelf.enableShowGesture = enableShowGesture - return newSelf } @@ -303,7 +299,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func maxSidebarWidth(_ maxSidebarWidth: Double?) -> Self { var newSelf = self newSelf.maxSidebarWidth = maxSidebarWidth - return newSelf } @@ -317,7 +312,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func minSidebarWidth(_ minSidebarWidth: Double?) -> Self { var newSelf = self newSelf.minSidebarWidth = minSidebarWidth - return newSelf } @@ -329,7 +323,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func pinSidebar(_ pinSidebar: Bool? = true) -> Self { var newSelf = self newSelf.pinSidebar = pinSidebar - return newSelf } @@ -337,7 +330,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func showSidebar(_ showSidebar: Binding?) -> Self { var newSelf = self newSelf.showSidebar = showSidebar - return newSelf } @@ -345,7 +337,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func sidebar(@ViewBuilder _ sidebar: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.sidebar = sidebar - return newSelf } @@ -360,7 +351,6 @@ if let showSidebar, newValue != showSidebar.wrappedValue { public func sidebarWidthFraction(_ sidebarWidthFraction: Double?) -> Self { var newSelf = self newSelf.sidebarWidthFraction = sidebarWidthFraction - return newSelf } diff --git a/Sources/Core/View/Generated/PasswordEntryRow.swift b/Sources/Core/View/Generated/PasswordEntryRow.swift index 6f4e17d..c3fde48 100644 --- a/Sources/Core/View/Generated/PasswordEntryRow.swift +++ b/Sources/Core/View/Generated/PasswordEntryRow.swift @@ -2,7 +2,7 @@ // PasswordEntryRow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -37,6 +37,8 @@ public struct PasswordEntryRow: AdwaitaWidget { /// /// Emoji replacement is done with :-delimited names, like `:heart:`. var enableEmojiCompletion: Bool? + /// Maximum number of characters for the entry. + var maxLength: Int? /// Whether to show the apply button. /// /// When set to `TRUE`, typing text in the entry will reveal an apply button. @@ -133,6 +135,9 @@ public struct PasswordEntryRow: AdwaitaWidget { if let enableEmojiCompletion, updateProperties, (storage.previousState as? Self)?.enableEmojiCompletion != enableEmojiCompletion { adw_entry_row_set_enable_emoji_completion(widget?.cast(), enableEmojiCompletion.cBool) } + if let maxLength, updateProperties, (storage.previousState as? Self)?.maxLength != maxLength { + adw_entry_row_set_max_length(widget?.cast(), maxLength.cInt) + } if let showApplyButton, updateProperties, (storage.previousState as? Self)?.showApplyButton != showApplyButton { adw_entry_row_set_show_apply_button(widget?.cast(), showApplyButton.cBool) } @@ -163,7 +168,6 @@ public struct PasswordEntryRow: AdwaitaWidget { public func activatesDefault(_ activatesDefault: Bool? = true) -> Self { var newSelf = self newSelf.activatesDefault = activatesDefault - return newSelf } @@ -173,7 +177,13 @@ public struct PasswordEntryRow: AdwaitaWidget { public func enableEmojiCompletion(_ enableEmojiCompletion: Bool? = true) -> Self { var newSelf = self newSelf.enableEmojiCompletion = enableEmojiCompletion - + return newSelf + } + + /// Maximum number of characters for the entry. + public func maxLength(_ maxLength: Int?) -> Self { + var newSelf = self + newSelf.maxLength = maxLength return newSelf } @@ -189,7 +199,6 @@ public struct PasswordEntryRow: AdwaitaWidget { public func showApplyButton(_ showApplyButton: Bool? = true) -> Self { var newSelf = self newSelf.showApplyButton = showApplyButton - return newSelf } @@ -197,7 +206,6 @@ public struct PasswordEntryRow: AdwaitaWidget { public func textLength(_ textLength: UInt?) -> Self { var newSelf = self newSelf.textLength = textLength - return newSelf } @@ -208,7 +216,6 @@ public struct PasswordEntryRow: AdwaitaWidget { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -218,7 +225,6 @@ public struct PasswordEntryRow: AdwaitaWidget { public func titleSelectable(_ titleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.titleSelectable = titleSelectable - return newSelf } @@ -230,7 +236,6 @@ public struct PasswordEntryRow: AdwaitaWidget { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -238,7 +243,6 @@ public struct PasswordEntryRow: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/Picture.swift b/Sources/Core/View/Generated/Picture.swift index 9ab7d2f..d04f86d 100644 --- a/Sources/Core/View/Generated/Picture.swift +++ b/Sources/Core/View/Generated/Picture.swift @@ -2,7 +2,7 @@ // Picture.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -126,7 +126,6 @@ public struct Picture: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -134,7 +133,6 @@ public struct Picture: AdwaitaWidget { public func alternativeText(_ alternativeText: String?) -> Self { var newSelf = self newSelf.alternativeText = alternativeText - return newSelf } @@ -142,7 +140,6 @@ public struct Picture: AdwaitaWidget { public func canShrink(_ canShrink: Bool? = true) -> Self { var newSelf = self newSelf.canShrink = canShrink - return newSelf } @@ -150,7 +147,6 @@ public struct Picture: AdwaitaWidget { public func contentFit(_ contentFit: ContentFit?) -> Self { var newSelf = self newSelf.contentFit = contentFit - return newSelf } diff --git a/Sources/Core/View/Generated/Popover.swift b/Sources/Core/View/Generated/Popover.swift index 72f8b62..5e712e2 100644 --- a/Sources/Core/View/Generated/Popover.swift +++ b/Sources/Core/View/Generated/Popover.swift @@ -2,7 +2,7 @@ // Popover.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -29,7 +29,7 @@ import LevenshteinTransformations /// /// ## GtkPopover as menu replacement /// -/// `GtkPopover` is often used to replace menus. The best was to do this +/// `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]. /// @@ -37,6 +37,17 @@ import LevenshteinTransformations ///
horizontal-buttonsCutapp.cutedit-cut-symbolicCopyapp.copyedit-copy-symbolicPasteapp.pasteedit-paste-symbolic
/// ``` /// +/// # Shortcuts and Gestures +/// +/// `GtkPopover` supports the following keyboard shortcuts: +/// +/// - Escape closes the popover. +/// - Alt makes the mnemonics visible. +/// +/// The following signals have default keybindings: +/// +/// - [signal@Gtk.Popover::activate-default] +/// /// # CSS nodes /// /// ``` @@ -96,6 +107,8 @@ public struct Popover: AdwaitaWidget { /// Emitted whend the user activates the default widget. /// /// This is a [keybinding signal](class.SignalAction.html). + /// + /// The default binding for this signal is Enter. var activateDefault: (() -> Void)? /// Emitted when the popover is closed. var closed: (() -> Void)? @@ -181,7 +194,6 @@ public struct Popover: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -189,7 +201,6 @@ public struct Popover: AdwaitaWidget { public func autohide(_ autohide: Bool? = true) -> Self { var newSelf = self newSelf.autohide = autohide - return newSelf } @@ -199,7 +210,6 @@ public struct Popover: AdwaitaWidget { public func cascadePopdown(_ cascadePopdown: Bool? = true) -> Self { var newSelf = self newSelf.cascadePopdown = cascadePopdown - return newSelf } @@ -207,7 +217,6 @@ public struct Popover: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -215,7 +224,6 @@ public struct Popover: AdwaitaWidget { public func defaultWidget(@ViewBuilder _ defaultWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.defaultWidget = defaultWidget - return newSelf } @@ -223,7 +231,6 @@ public struct Popover: AdwaitaWidget { public func hasArrow(_ hasArrow: Bool? = true) -> Self { var newSelf = self newSelf.hasArrow = hasArrow - return newSelf } @@ -231,13 +238,14 @@ public struct Popover: AdwaitaWidget { public func mnemonicsVisible(_ mnemonicsVisible: Bool? = true) -> Self { var newSelf = self newSelf.mnemonicsVisible = mnemonicsVisible - return newSelf } /// Emitted whend the user activates the default widget. /// /// This is a [keybinding signal](class.SignalAction.html). + /// + /// The default binding for this signal is Enter. public func activateDefault(_ activateDefault: @escaping () -> Void) -> Self { var newSelf = self newSelf.activateDefault = activateDefault diff --git a/Sources/Core/View/Generated/PreferencesGroup.swift b/Sources/Core/View/Generated/PreferencesGroup.swift index 37fc002..3675019 100644 --- a/Sources/Core/View/Generated/PreferencesGroup.swift +++ b/Sources/Core/View/Generated/PreferencesGroup.swift @@ -2,7 +2,7 @@ // PreferencesGroup.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -19,6 +19,11 @@ import LevenshteinTransformations /// title and a description. The title will be used by [class@PreferencesDialog] /// to let the user look for a preference. /// +/// The [property@PreferencesGroup:separate-rows] 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 @@ -52,6 +57,12 @@ public struct PreferencesGroup: AdwaitaWidget { /// Suffixes are commonly used to show a button or a spinner for the whole /// group. var headerSuffix: (() -> Body)? + /// 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`. + var separateRows: Bool? /// The title for this group of preferences. var title: String? /// The body for the widget "child". @@ -101,6 +112,9 @@ public struct PreferencesGroup: AdwaitaWidget { if let widget = storage.content["headerSuffix"]?.first { headerSuffix?().updateStorage(widget, data: data, updateProperties: updateProperties, type: type) } + if let separateRows, updateProperties, (storage.previousState as? Self)?.separateRows != separateRows { + adw_preferences_group_set_separate_rows(widget?.cast(), separateRows.cBool) + } if let title, updateProperties, (storage.previousState as? Self)?.title != title { adw_preferences_group_set_title(widget?.cast(), title) } @@ -131,7 +145,6 @@ public struct PreferencesGroup: AdwaitaWidget { public func description(_ description: String?) -> Self { var newSelf = self newSelf.description = description - return newSelf } @@ -144,7 +157,17 @@ public struct PreferencesGroup: AdwaitaWidget { public func headerSuffix(@ViewBuilder _ headerSuffix: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.headerSuffix = headerSuffix - + return newSelf + } + + /// 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`. + public func separateRows(_ separateRows: Bool? = true) -> Self { + var newSelf = self + newSelf.separateRows = separateRows return newSelf } @@ -152,7 +175,6 @@ public struct PreferencesGroup: AdwaitaWidget { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } diff --git a/Sources/Core/View/Generated/PreferencesPage.swift b/Sources/Core/View/Generated/PreferencesPage.swift index b56023b..441b3ea 100644 --- a/Sources/Core/View/Generated/PreferencesPage.swift +++ b/Sources/Core/View/Generated/PreferencesPage.swift @@ -2,7 +2,7 @@ // PreferencesPage.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -31,6 +31,8 @@ public struct PreferencesPage: AdwaitaWidget { /// The description to be displayed at the top of the page. var description: String? + /// Whether the description should be centered. + var descriptionCentered: Bool? /// The icon name for this page. var iconName: String? /// The name of this page. @@ -79,6 +81,9 @@ public struct PreferencesPage: AdwaitaWidget { if let description, updateProperties, (storage.previousState as? Self)?.description != description { adw_preferences_page_set_description(widget?.cast(), description) } + if let descriptionCentered, updateProperties, (storage.previousState as? Self)?.descriptionCentered != descriptionCentered { + adw_preferences_page_set_description_centered(widget?.cast(), descriptionCentered.cBool) + } if let iconName, updateProperties, (storage.previousState as? Self)?.iconName != iconName { adw_preferences_page_set_icon_name(widget?.cast(), iconName) } @@ -118,7 +123,13 @@ public struct PreferencesPage: AdwaitaWidget { public func description(_ description: String?) -> Self { var newSelf = self newSelf.description = description - + return newSelf + } + + /// Whether the description should be centered. + public func descriptionCentered(_ descriptionCentered: Bool? = true) -> Self { + var newSelf = self + newSelf.descriptionCentered = descriptionCentered return newSelf } @@ -126,7 +137,6 @@ public struct PreferencesPage: AdwaitaWidget { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -134,7 +144,6 @@ public struct PreferencesPage: AdwaitaWidget { public func name(_ name: String?) -> Self { var newSelf = self newSelf.name = name - return newSelf } @@ -142,7 +151,6 @@ public struct PreferencesPage: AdwaitaWidget { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -150,7 +158,6 @@ public struct PreferencesPage: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/PreferencesRow.swift b/Sources/Core/View/Generated/PreferencesRow.swift index 7d1159b..9ad45c6 100644 --- a/Sources/Core/View/Generated/PreferencesRow.swift +++ b/Sources/Core/View/Generated/PreferencesRow.swift @@ -2,7 +2,7 @@ // PreferencesRow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -100,7 +100,6 @@ public struct PreferencesRow: AdwaitaWidget { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -110,7 +109,6 @@ public struct PreferencesRow: AdwaitaWidget { public func titleSelectable(_ titleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.titleSelectable = titleSelectable - return newSelf } @@ -122,7 +120,6 @@ public struct PreferencesRow: AdwaitaWidget { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -130,7 +127,6 @@ public struct PreferencesRow: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/ProgressBar.swift b/Sources/Core/View/Generated/ProgressBar.swift index 86be3eb..fb53d63 100644 --- a/Sources/Core/View/Generated/ProgressBar.swift +++ b/Sources/Core/View/Generated/ProgressBar.swift @@ -2,7 +2,7 @@ // ProgressBar.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -145,7 +145,6 @@ public struct ProgressBar: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -153,7 +152,6 @@ public struct ProgressBar: AdwaitaWidget { public func fraction(_ fraction: Double?) -> Self { var newSelf = self newSelf.fraction = fraction - return newSelf } @@ -161,7 +159,6 @@ public struct ProgressBar: AdwaitaWidget { public func inverted(_ inverted: Bool? = true) -> Self { var newSelf = self newSelf.inverted = inverted - return newSelf } @@ -169,7 +166,6 @@ public struct ProgressBar: AdwaitaWidget { public func pulseStep(_ pulseStep: Double?) -> Self { var newSelf = self newSelf.pulseStep = pulseStep - return newSelf } @@ -186,7 +182,6 @@ public struct ProgressBar: AdwaitaWidget { public func showText(_ showText: Bool? = true) -> Self { var newSelf = self newSelf.showText = showText - return newSelf } @@ -194,7 +189,6 @@ public struct ProgressBar: AdwaitaWidget { public func text(_ text: String?) -> Self { var newSelf = self newSelf.text = text - return newSelf } diff --git a/Sources/Core/View/Generated/ScrolledWindow.swift b/Sources/Core/View/Generated/ScrolledWindow.swift index ce38231..7b3be35 100644 --- a/Sources/Core/View/Generated/ScrolledWindow.swift +++ b/Sources/Core/View/Generated/ScrolledWindow.swift @@ -2,7 +2,7 @@ // ScrolledWindow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -54,6 +54,12 @@ import LevenshteinTransformations /// 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. @@ -154,8 +160,8 @@ public struct ScrolledWindow: AdwaitaWidget { /// This is a [keybinding signal](class.SignalAction.html). /// /// The default bindings for this signal are - /// `Ctrl + Tab` to move forward and `Ctrl + Shift + Tab` to - /// move backward. + /// Ctrl+Tab to move forward and + /// Ctrl+Shift+Tab` to move backward. var moveFocusOut: (() -> Void)? /// Emitted when a keybinding that scrolls is pressed. /// @@ -264,7 +270,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -276,7 +281,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -284,7 +288,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func hasFrame(_ hasFrame: Bool? = true) -> Self { var newSelf = self newSelf.hasFrame = hasFrame - return newSelf } @@ -294,7 +297,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func kineticScrolling(_ kineticScrolling: Bool? = true) -> Self { var newSelf = self newSelf.kineticScrolling = kineticScrolling - return newSelf } @@ -302,7 +304,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func maxContentHeight(_ maxContentHeight: Int?) -> Self { var newSelf = self newSelf.maxContentHeight = maxContentHeight - return newSelf } @@ -310,7 +311,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func maxContentWidth(_ maxContentWidth: Int?) -> Self { var newSelf = self newSelf.maxContentWidth = maxContentWidth - return newSelf } @@ -318,7 +318,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func minContentHeight(_ minContentHeight: Int?) -> Self { var newSelf = self newSelf.minContentHeight = minContentHeight - return newSelf } @@ -326,7 +325,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func minContentWidth(_ minContentWidth: Int?) -> Self { var newSelf = self newSelf.minContentWidth = minContentWidth - return newSelf } @@ -341,7 +339,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func overlayScrolling(_ overlayScrolling: Bool? = true) -> Self { var newSelf = self newSelf.overlayScrolling = overlayScrolling - return newSelf } @@ -353,7 +350,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func propagateNaturalHeight(_ propagateNaturalHeight: Bool? = true) -> Self { var newSelf = self newSelf.propagateNaturalHeight = propagateNaturalHeight - return newSelf } @@ -365,7 +361,6 @@ public struct ScrolledWindow: AdwaitaWidget { public func propagateNaturalWidth(_ propagateNaturalWidth: Bool? = true) -> Self { var newSelf = self newSelf.propagateNaturalWidth = propagateNaturalWidth - return newSelf } @@ -405,8 +400,8 @@ public struct ScrolledWindow: AdwaitaWidget { /// This is a [keybinding signal](class.SignalAction.html). /// /// The default bindings for this signal are - /// `Ctrl + Tab` to move forward and `Ctrl + Shift + Tab` to - /// move backward. + /// Ctrl+Tab to move forward and + /// Ctrl+Shift+Tab` to move backward. public func moveFocusOut(_ moveFocusOut: @escaping () -> Void) -> Self { var newSelf = self newSelf.moveFocusOut = moveFocusOut diff --git a/Sources/Core/View/Generated/SearchBar.swift b/Sources/Core/View/Generated/SearchBar.swift index f33b2ba..8b827ee 100644 --- a/Sources/Core/View/Generated/SearchBar.swift +++ b/Sources/Core/View/Generated/SearchBar.swift @@ -2,7 +2,7 @@ // SearchBar.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -34,6 +34,12 @@ import LevenshteinTransformations /// /// [A simple example](https://gitlab.gnome.org/GNOME/gtk/tree/main/examples/search-bar.c) /// +/// # Shortcuts and Gestures +/// +/// `GtkSearchBar` supports the following keyboard shortcuts: +/// +/// - Escape hides the search bar. +/// /// # CSS nodes /// /// ``` @@ -114,6 +120,9 @@ public struct SearchBar: AdwaitaWidget { if let widget = storage.content["keyCaptureWidget"]?.first { keyCaptureWidget?().updateStorage(widget, data: data, updateProperties: updateProperties, type: type) } + if let searchModeEnabled, updateProperties, (storage.previousState as? Self)?.searchModeEnabled != searchModeEnabled { + gtk_search_bar_set_search_mode(widget, searchModeEnabled.cBool) + } if let showCloseButton, updateProperties, (storage.previousState as? Self)?.showCloseButton != showCloseButton { gtk_search_bar_set_show_close_button(widget, showCloseButton.cBool) } @@ -134,7 +143,6 @@ public struct SearchBar: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -142,7 +150,6 @@ public struct SearchBar: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -150,7 +157,6 @@ public struct SearchBar: AdwaitaWidget { public func keyCaptureWidget(@ViewBuilder _ keyCaptureWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.keyCaptureWidget = keyCaptureWidget - return newSelf } @@ -158,7 +164,6 @@ public struct SearchBar: AdwaitaWidget { public func searchModeEnabled(_ searchModeEnabled: Bool? = true) -> Self { var newSelf = self newSelf.searchModeEnabled = searchModeEnabled - return newSelf } @@ -166,7 +171,6 @@ public struct SearchBar: AdwaitaWidget { public func showCloseButton(_ showCloseButton: Bool? = true) -> Self { var newSelf = self newSelf.showCloseButton = showCloseButton - return newSelf } diff --git a/Sources/Core/View/Generated/SearchEntry.swift b/Sources/Core/View/Generated/SearchEntry.swift index bc57c4c..c8abab6 100644 --- a/Sources/Core/View/Generated/SearchEntry.swift +++ b/Sources/Core/View/Generated/SearchEntry.swift @@ -2,7 +2,7 @@ // SearchEntry.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -39,6 +39,15 @@ import LevenshteinTransformations /// `GtkSearchEntry` provides only minimal API and should be used with /// the [iface@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 /// /// ``` @@ -91,7 +100,7 @@ public struct SearchEntry: AdwaitaWidget { var xalign: Float? /// Emitted when the entry is activated. /// - /// The keybindings for this signal are all forms of the Enter key. + /// The keybindings for this signal are all forms of the Enter key. var activate: (() -> Void)? /// Emitted at the end of a single user-visible operation on the /// contents. @@ -127,7 +136,7 @@ public struct SearchEntry: AdwaitaWidget { /// Applications should connect to it, to implement moving /// between matches. /// - /// The default bindings for this signal is Ctrl-g. + /// The default bindings for this signal is Ctrl+g. var nextMatch: (() -> Void)? /// Emitted when the user initiates a move to the previous match /// for the current search string. @@ -137,7 +146,8 @@ public struct SearchEntry: AdwaitaWidget { /// Applications should connect to it, to implement moving /// between matches. /// - /// The default bindings for this signal is Ctrl-Shift-g. + /// The default bindings for this signal is + /// Ctrl+Shift+g. var previousMatch: (() -> Void)? /// Emitted with a delay. The length of the delay can be /// changed with the [property@Gtk.SearchEntry:search-delay] @@ -152,7 +162,7 @@ public struct SearchEntry: AdwaitaWidget { /// Applications should connect to it, to implement hiding /// the search entry in this case. /// - /// The default bindings for this signal is Escape. + /// The default bindings for this signal is Escape. var stopSearch: (() -> Void)? /// Initialize `SearchEntry`. @@ -234,6 +244,9 @@ if let text, newValue != text.wrappedValue { text.wrappedValue = newValue } } + if let cursorPosition, updateProperties, (storage.previousState as? Self)?.cursorPosition != cursorPosition { + gtk_editable_set_position(widget, cursorPosition.cInt) + } if let editable, updateProperties, (storage.previousState as? Self)?.editable != editable { gtk_editable_set_editable(widget, editable.cBool) } @@ -255,6 +268,9 @@ if let text, newValue != text.wrappedValue { if let widthChars, updateProperties, (storage.previousState as? Self)?.widthChars != widthChars { gtk_editable_set_width_chars(widget, widthChars.cInt) } + if let xalign, updateProperties, (storage.previousState as? Self)?.xalign != xalign { + gtk_editable_set_alignment(widget, xalign) + } } @@ -272,7 +288,6 @@ if let text, newValue != text.wrappedValue { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -280,7 +295,6 @@ if let text, newValue != text.wrappedValue { public func activatesDefault(_ activatesDefault: Bool? = true) -> Self { var newSelf = self newSelf.activatesDefault = activatesDefault - return newSelf } @@ -288,7 +302,6 @@ if let text, newValue != text.wrappedValue { public func cursorPosition(_ cursorPosition: Int?) -> Self { var newSelf = self newSelf.cursorPosition = cursorPosition - return newSelf } @@ -296,7 +309,6 @@ if let text, newValue != text.wrappedValue { public func editable(_ editable: Bool? = true) -> Self { var newSelf = self newSelf.editable = editable - return newSelf } @@ -304,7 +316,6 @@ if let text, newValue != text.wrappedValue { public func enableUndo(_ enableUndo: Bool? = true) -> Self { var newSelf = self newSelf.enableUndo = enableUndo - return newSelf } @@ -312,7 +323,6 @@ if let text, newValue != text.wrappedValue { public func maxWidthChars(_ maxWidthChars: Int?) -> Self { var newSelf = self newSelf.maxWidthChars = maxWidthChars - return newSelf } @@ -321,7 +331,6 @@ if let text, newValue != text.wrappedValue { public func placeholderText(_ placeholderText: String?) -> Self { var newSelf = self newSelf.placeholderText = placeholderText - return newSelf } @@ -330,7 +339,6 @@ if let text, newValue != text.wrappedValue { public func searchDelay(_ searchDelay: UInt?) -> Self { var newSelf = self newSelf.searchDelay = searchDelay - return newSelf } @@ -338,7 +346,6 @@ if let text, newValue != text.wrappedValue { public func selectionBound(_ selectionBound: Int?) -> Self { var newSelf = self newSelf.selectionBound = selectionBound - return newSelf } @@ -346,7 +353,6 @@ if let text, newValue != text.wrappedValue { public func text(_ text: Binding?) -> Self { var newSelf = self newSelf.text = text - return newSelf } @@ -354,7 +360,6 @@ if let text, newValue != text.wrappedValue { public func widthChars(_ widthChars: Int?) -> Self { var newSelf = self newSelf.widthChars = widthChars - return newSelf } @@ -364,13 +369,12 @@ if let text, newValue != text.wrappedValue { public func xalign(_ xalign: Float?) -> Self { var newSelf = self newSelf.xalign = xalign - return newSelf } /// Emitted when the entry is activated. /// - /// The keybindings for this signal are all forms of the Enter key. + /// The keybindings for this signal are all forms of the Enter key. public func activate(_ activate: @escaping () -> Void) -> Self { var newSelf = self newSelf.activate = activate @@ -426,7 +430,7 @@ if let text, newValue != text.wrappedValue { /// Applications should connect to it, to implement moving /// between matches. /// - /// The default bindings for this signal is Ctrl-g. + /// The default bindings for this signal is Ctrl+g. public func nextMatch(_ nextMatch: @escaping () -> Void) -> Self { var newSelf = self newSelf.nextMatch = nextMatch @@ -441,7 +445,8 @@ if let text, newValue != text.wrappedValue { /// Applications should connect to it, to implement moving /// between matches. /// - /// The default bindings for this signal is Ctrl-Shift-g. + /// The default bindings for this signal is + /// Ctrl+Shift+g. public func previousMatch(_ previousMatch: @escaping () -> Void) -> Self { var newSelf = self newSelf.previousMatch = previousMatch @@ -471,7 +476,7 @@ if let text, newValue != text.wrappedValue { /// Applications should connect to it, to implement hiding /// the search entry in this case. /// - /// The default bindings for this signal is Escape. + /// The default bindings for this signal is Escape. public func stopSearch(_ stopSearch: @escaping () -> Void) -> Self { var newSelf = self newSelf.stopSearch = stopSearch diff --git a/Sources/Core/View/Generated/Separator.swift b/Sources/Core/View/Generated/Separator.swift index 5069afd..e38baca 100644 --- a/Sources/Core/View/Generated/Separator.swift +++ b/Sources/Core/View/Generated/Separator.swift @@ -2,7 +2,7 @@ // Separator.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -81,7 +81,6 @@ public struct Separator: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } diff --git a/Sources/Core/View/Generated/SpinRow.swift b/Sources/Core/View/Generated/SpinRow.swift index bb9d5e2..89f274e 100644 --- a/Sources/Core/View/Generated/SpinRow.swift +++ b/Sources/Core/View/Generated/SpinRow.swift @@ -2,7 +2,7 @@ // SpinRow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -24,6 +24,11 @@ import LevenshteinTransformations /// /// `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. @@ -252,7 +257,6 @@ if let value, newValue != value.wrappedValue { public func activatableWidget(@ViewBuilder _ activatableWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.activatableWidget = activatableWidget - return newSelf } @@ -260,7 +264,6 @@ if let value, newValue != value.wrappedValue { public func climbRate(_ climbRate: Double) -> Self { var newSelf = self newSelf.climbRate = climbRate - return newSelf } @@ -268,7 +271,6 @@ if let value, newValue != value.wrappedValue { public func digits(_ digits: UInt) -> Self { var newSelf = self newSelf.digits = digits - return newSelf } @@ -276,7 +278,6 @@ if let value, newValue != value.wrappedValue { public func numeric(_ numeric: Bool? = true) -> Self { var newSelf = self newSelf.numeric = numeric - return newSelf } @@ -284,7 +285,6 @@ if let value, newValue != value.wrappedValue { public func snapToTicks(_ snapToTicks: Bool? = true) -> Self { var newSelf = self newSelf.snapToTicks = snapToTicks - return newSelf } @@ -295,7 +295,6 @@ if let value, newValue != value.wrappedValue { public func subtitle(_ subtitle: String?) -> Self { var newSelf = self newSelf.subtitle = subtitle - return newSelf } @@ -306,7 +305,6 @@ if let value, newValue != value.wrappedValue { public func subtitleLines(_ subtitleLines: Int?) -> Self { var newSelf = self newSelf.subtitleLines = subtitleLines - return newSelf } @@ -316,7 +314,6 @@ if let value, newValue != value.wrappedValue { public func subtitleSelectable(_ subtitleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.subtitleSelectable = subtitleSelectable - return newSelf } @@ -327,7 +324,6 @@ if let value, newValue != value.wrappedValue { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -337,7 +333,6 @@ if let value, newValue != value.wrappedValue { public func titleLines(_ titleLines: Int?) -> Self { var newSelf = self newSelf.titleLines = titleLines - return newSelf } @@ -347,7 +342,6 @@ if let value, newValue != value.wrappedValue { public func titleSelectable(_ titleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.titleSelectable = titleSelectable - return newSelf } @@ -359,7 +353,6 @@ if let value, newValue != value.wrappedValue { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -367,7 +360,6 @@ if let value, newValue != value.wrappedValue { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } @@ -375,7 +367,6 @@ if let value, newValue != value.wrappedValue { public func value(_ value: Binding?) -> Self { var newSelf = self newSelf.value = value - return newSelf } @@ -383,7 +374,6 @@ if let value, newValue != value.wrappedValue { public func wrap(_ wrap: Bool? = true) -> Self { var newSelf = self newSelf.wrap = wrap - return newSelf } diff --git a/Sources/Core/View/Generated/Spinner.swift b/Sources/Core/View/Generated/Spinner.swift index 04c9a3c..723ed8f 100644 --- a/Sources/Core/View/Generated/Spinner.swift +++ b/Sources/Core/View/Generated/Spinner.swift @@ -2,7 +2,7 @@ // Spinner.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -85,7 +85,6 @@ public struct Spinner: AdwaitaWidget { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } @@ -93,7 +92,6 @@ public struct Spinner: AdwaitaWidget { public func spinning(_ spinning: Bool? = true) -> Self { var newSelf = self newSelf.spinning = spinning - return newSelf } diff --git a/Sources/Core/View/Generated/SplitButton.swift b/Sources/Core/View/Generated/SplitButton.swift index 26be10d..84c03c8 100644 --- a/Sources/Core/View/Generated/SplitButton.swift +++ b/Sources/Core/View/Generated/SplitButton.swift @@ -2,7 +2,7 @@ // SplitButton.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -37,6 +37,17 @@ import LevenshteinTransformations /// 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. @@ -185,7 +196,6 @@ public struct SplitButton: AdwaitaWidget { public func canShrink(_ canShrink: Bool? = true) -> Self { var newSelf = self newSelf.canShrink = canShrink - return newSelf } @@ -196,7 +206,6 @@ public struct SplitButton: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -206,7 +215,6 @@ public struct SplitButton: AdwaitaWidget { public func dropdownTooltip(_ dropdownTooltip: String?) -> Self { var newSelf = self newSelf.dropdownTooltip = dropdownTooltip - return newSelf } @@ -217,7 +225,6 @@ public struct SplitButton: AdwaitaWidget { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -228,7 +235,6 @@ public struct SplitButton: AdwaitaWidget { public func label(_ label: String?) -> Self { var newSelf = self newSelf.label = label - return newSelf } @@ -245,7 +251,6 @@ public struct SplitButton: AdwaitaWidget { public func menuModel(@ViewBuilder _ menuModel: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.menuModel = menuModel - return newSelf } @@ -255,7 +260,6 @@ public struct SplitButton: AdwaitaWidget { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/StatusPage.swift b/Sources/Core/View/Generated/StatusPage.swift index 112b917..e4b8b4e 100644 --- a/Sources/Core/View/Generated/StatusPage.swift +++ b/Sources/Core/View/Generated/StatusPage.swift @@ -2,7 +2,7 @@ // StatusPage.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -19,9 +19,18 @@ import LevenshteinTransformations /// /// `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. +/// needs to fit into a small space such a sidebar or a popover, similar to when +/// using a spinner as the paintable. +/// +/// status-page-compact public struct StatusPage: AdwaitaWidget { /// Additional update functions for type extensions. @@ -101,7 +110,6 @@ public struct StatusPage: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -109,7 +117,6 @@ public struct StatusPage: AdwaitaWidget { public func description(_ description: String?) -> Self { var newSelf = self newSelf.description = description - return newSelf } @@ -119,7 +126,6 @@ public struct StatusPage: AdwaitaWidget { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -129,7 +135,6 @@ public struct StatusPage: AdwaitaWidget { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } diff --git a/Sources/Core/View/Generated/SwitchRow.swift b/Sources/Core/View/Generated/SwitchRow.swift index 5600c6b..bd41e1e 100644 --- a/Sources/Core/View/Generated/SwitchRow.swift +++ b/Sources/Core/View/Generated/SwitchRow.swift @@ -2,7 +2,7 @@ // SwitchRow.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -28,6 +28,10 @@ import LevenshteinTransformations /// /// The [property@SwitchRow: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. @@ -197,7 +201,6 @@ if let active, newValue != active.wrappedValue { public func activatableWidget(@ViewBuilder _ activatableWidget: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.activatableWidget = activatableWidget - return newSelf } @@ -205,7 +208,6 @@ if let active, newValue != active.wrappedValue { public func active(_ active: Binding?) -> Self { var newSelf = self newSelf.active = active - return newSelf } @@ -216,7 +218,6 @@ if let active, newValue != active.wrappedValue { public func subtitle(_ subtitle: String?) -> Self { var newSelf = self newSelf.subtitle = subtitle - return newSelf } @@ -227,7 +228,6 @@ if let active, newValue != active.wrappedValue { public func subtitleLines(_ subtitleLines: Int?) -> Self { var newSelf = self newSelf.subtitleLines = subtitleLines - return newSelf } @@ -237,7 +237,6 @@ if let active, newValue != active.wrappedValue { public func subtitleSelectable(_ subtitleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.subtitleSelectable = subtitleSelectable - return newSelf } @@ -248,7 +247,6 @@ if let active, newValue != active.wrappedValue { public func title(_ title: String?) -> Self { var newSelf = self newSelf.title = title - return newSelf } @@ -258,7 +256,6 @@ if let active, newValue != active.wrappedValue { public func titleLines(_ titleLines: Int?) -> Self { var newSelf = self newSelf.titleLines = titleLines - return newSelf } @@ -268,7 +265,6 @@ if let active, newValue != active.wrappedValue { public func titleSelectable(_ titleSelectable: Bool? = true) -> Self { var newSelf = self newSelf.titleSelectable = titleSelectable - return newSelf } @@ -280,7 +276,6 @@ if let active, newValue != active.wrappedValue { public func useMarkup(_ useMarkup: Bool? = true) -> Self { var newSelf = self newSelf.useMarkup = useMarkup - return newSelf } @@ -288,7 +283,6 @@ if let active, newValue != active.wrappedValue { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/ToastOverlay.swift b/Sources/Core/View/Generated/ToastOverlay.swift index 00885ba..f5b0c31 100644 --- a/Sources/Core/View/Generated/ToastOverlay.swift +++ b/Sources/Core/View/Generated/ToastOverlay.swift @@ -2,7 +2,7 @@ // ToastOverlay.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -104,7 +104,6 @@ public struct ToastOverlay: AdwaitaWidget { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } diff --git a/Sources/Core/View/Generated/ToggleButton.swift b/Sources/Core/View/Generated/ToggleButton.swift index 49e24d5..37692e4 100644 --- a/Sources/Core/View/Generated/ToggleButton.swift +++ b/Sources/Core/View/Generated/ToggleButton.swift @@ -2,7 +2,7 @@ // ToggleButton.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -94,7 +94,7 @@ public struct ToggleButton: AdwaitaWidget { /// /// The accessible role cannot be changed once set. var accessibleRole: String? -/// action-name + /// The name of the action with which this widget should be associated. var actionName: String? /// If the toggle button should be pressed in. var active: Binding? @@ -224,15 +224,13 @@ if let active, newValue != active.wrappedValue { public func accessibleRole(_ accessibleRole: String?) -> Self { var newSelf = self newSelf.accessibleRole = accessibleRole - return newSelf } -/// action-name + /// The name of the action with which this widget should be associated. public func actionName(_ actionName: String?) -> Self { var newSelf = self newSelf.actionName = actionName - return newSelf } @@ -240,7 +238,6 @@ if let active, newValue != active.wrappedValue { public func active(_ active: Binding?) -> Self { var newSelf = self newSelf.active = active - return newSelf } @@ -254,7 +251,6 @@ if let active, newValue != active.wrappedValue { public func canShrink(_ canShrink: Bool? = true) -> Self { var newSelf = self newSelf.canShrink = canShrink - return newSelf } @@ -262,7 +258,6 @@ if let active, newValue != active.wrappedValue { public func child(@ViewBuilder _ child: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.child = child - return newSelf } @@ -270,7 +265,6 @@ if let active, newValue != active.wrappedValue { public func hasFrame(_ hasFrame: Bool? = true) -> Self { var newSelf = self newSelf.hasFrame = hasFrame - return newSelf } @@ -278,7 +272,6 @@ if let active, newValue != active.wrappedValue { public func iconName(_ iconName: String?) -> Self { var newSelf = self newSelf.iconName = iconName - return newSelf } @@ -286,7 +279,6 @@ if let active, newValue != active.wrappedValue { public func label(_ label: String?) -> Self { var newSelf = self newSelf.label = label - return newSelf } @@ -295,7 +287,6 @@ if let active, newValue != active.wrappedValue { public func useUnderline(_ useUnderline: Bool? = true) -> Self { var newSelf = self newSelf.useUnderline = useUnderline - return newSelf } diff --git a/Sources/Core/View/Generated/ToolbarView.swift b/Sources/Core/View/Generated/ToolbarView.swift index db66f3d..68d0221 100644 --- a/Sources/Core/View/Generated/ToolbarView.swift +++ b/Sources/Core/View/Generated/ToolbarView.swift @@ -2,7 +2,7 @@ // ToolbarView.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -242,7 +242,6 @@ public struct ToolbarView: AdwaitaWidget { public func bottomBarHeight(_ bottomBarHeight: Int?) -> Self { var newSelf = self newSelf.bottomBarHeight = bottomBarHeight - return newSelf } @@ -250,7 +249,6 @@ public struct ToolbarView: AdwaitaWidget { public func content(@ViewBuilder _ content: @escaping (() -> Body)) -> Self { var newSelf = self newSelf.content = content - return newSelf } @@ -264,7 +262,6 @@ public struct ToolbarView: AdwaitaWidget { public func extendContentToBottomEdge(_ extendContentToBottomEdge: Bool? = true) -> Self { var newSelf = self newSelf.extendContentToBottomEdge = extendContentToBottomEdge - return newSelf } @@ -277,7 +274,6 @@ public struct ToolbarView: AdwaitaWidget { public func extendContentToTopEdge(_ extendContentToTopEdge: Bool? = true) -> Self { var newSelf = self newSelf.extendContentToTopEdge = extendContentToTopEdge - return newSelf } @@ -293,7 +289,6 @@ public struct ToolbarView: AdwaitaWidget { public func revealBottomBars(_ revealBottomBars: Bool? = true) -> Self { var newSelf = self newSelf.revealBottomBars = revealBottomBars - return newSelf } @@ -309,7 +304,6 @@ public struct ToolbarView: AdwaitaWidget { public func revealTopBars(_ revealTopBars: Bool? = true) -> Self { var newSelf = self newSelf.revealTopBars = revealTopBars - return newSelf } @@ -322,7 +316,6 @@ public struct ToolbarView: AdwaitaWidget { public func topBarHeight(_ topBarHeight: Int?) -> Self { var newSelf = self newSelf.topBarHeight = topBarHeight - return newSelf } diff --git a/Sources/Core/View/Generated/WindowTitle.swift b/Sources/Core/View/Generated/WindowTitle.swift index 0dcd60d..6646a9e 100644 --- a/Sources/Core/View/Generated/WindowTitle.swift +++ b/Sources/Core/View/Generated/WindowTitle.swift @@ -2,7 +2,7 @@ // WindowTitle.swift // Adwaita // -// Created by auto-generation on 15.08.24. +// Created by auto-generation on 22.10.24. // import CAdw @@ -88,7 +88,6 @@ public struct WindowTitle: AdwaitaWidget { public func subtitle(_ subtitle: String) -> Self { var newSelf = self newSelf.subtitle = subtitle - return newSelf } @@ -99,7 +98,6 @@ public struct WindowTitle: AdwaitaWidget { public func title(_ title: String) -> Self { var newSelf = self newSelf.title = title - return newSelf } diff --git a/Sources/Generation/GenerationConfiguration.swift b/Sources/Generation/GenerationConfiguration.swift index aa4724f..6885872 100644 --- a/Sources/Generation/GenerationConfiguration.swift +++ b/Sources/Generation/GenerationConfiguration.swift @@ -78,7 +78,9 @@ struct GenerationConfiguration { .init( class: "ComboRow", bindings: [.init(property: "selected")], - excludeProperties: ["expression", "factory", "list-factory", "model", "selected-item"], + excludeProperties: [ + "expression", "factory", "list-factory", "model", "selected-item", "header-factory", "search-match-mode" + ], cast: true ), .init(