Improve updating performance

And update docs reflecting the changes in the latest commits
This commit is contained in:
david-swift 2024-01-27 08:07:05 +01:00
parent dc41f50c52
commit 4937c36b3b
171 changed files with 9273 additions and 1017 deletions

View File

@ -18,22 +18,30 @@
- [AboutWindow](structs/AboutWindow.md)
- [ActionRow](structs/ActionRow.md)
- [AppearObserver](structs/AppearObserver.md)
- [Avatar](structs/Avatar.md)
- [Banner](structs/Banner.md)
- [Bin](structs/Bin.md)
- [Binding](structs/Binding.md)
- [Box](structs/Box.md)
- [Button](structs/Button.md)
- [ButtonContent](structs/ButtonContent.md)
- [Carousel](structs/Carousel.md)
- [CenterBox](structs/CenterBox.md)
- [CheckButton](structs/CheckButton.md)
- [Clamp](structs/Clamp.md)
- [ComboRow](structs/ComboRow.md)
- [Container](structs/Container.md)
- [ContentModifier](structs/ContentModifier.md)
- [EntryRow](structs/EntryRow.md)
- [ExpanderRow](structs/ExpanderRow.md)
- [FileDialog](structs/FileDialog.md)
- [Form](structs/Form.md)
- [FormSection](structs/FormSection.md)
- [HStack](structs/HStack.md)
- [HeaderBar](structs/HeaderBar.md)
- [InspectorWrapper](structs/InspectorWrapper.md)
- [List](structs/List.md)
- [Label](structs/Label.md)
- [LevelBar](structs/LevelBar.md)
- [LinkButton](structs/LinkButton.md)
- [ListBox](structs/ListBox.md)
- [Menu](structs/Menu.md)
- [MenuButton](structs/MenuButton.md)
- [MenuSection](structs/MenuSection.md)
@ -41,50 +49,91 @@
- [NavigationSplitView](structs/NavigationSplitView.md)
- [Overlay](structs/Overlay.md)
- [OverlaySplitView](structs/OverlaySplitView.md)
- [PasswordEntryRow](structs/PasswordEntryRow.md)
- [PreferencesGroup](structs/PreferencesGroup.md)
- [PreferencesPage](structs/PreferencesPage.md)
- [PreferencesRow](structs/PreferencesRow.md)
- [ProgressBar](structs/ProgressBar.md)
- [ScrollView](structs/ScrollView.md)
- [ScrolledWindow](structs/ScrolledWindow.md)
- [Signal](structs/Signal.md)
- [SpinRow](structs/SpinRow.md)
- [Spinner](structs/Spinner.md)
- [SplitButton](structs/SplitButton.md)
- [State](structs/State.md)
- [StateWrapper](structs/StateWrapper.md)
- [StatusPage](structs/StatusPage.md)
- [Submenu](structs/Submenu.md)
- [SwitchRow](structs/SwitchRow.md)
- [Text](structs/Text.md)
- [ToastOverlay](structs/ToastOverlay.md)
- [Toggle](structs/Toggle.md)
- [ToggleButton](structs/ToggleButton.md)
- [ToolbarView](structs/ToolbarView.md)
- [VStack](structs/VStack.md)
- [ViewStack](structs/ViewStack.md)
- [ViewSwitcher](structs/ViewSwitcher.md)
- [Window](structs/Window.md)
- [WindowTitle](structs/WindowTitle.md)
## Classes
- [GTUIAboutWindow](classes/GTUIAboutWindow.md)
- [GTUIApp](classes/GTUIApp.md)
- [GTUIApplicationWindow](classes/GTUIApplicationWindow.md)
- [GTUIFileDialog](classes/GTUIFileDialog.md)
- [GTUIWindow](classes/GTUIWindow.md)
- [State.Content](classes/State.Content.md)
- [State.Storage](classes/State.Storage.md)
- [ViewStorage](classes/ViewStorage.md)
- [ViewStorage.SignalData](classes/ViewStorage.SignalData.md)
- [WindowStorage](classes/WindowStorage.md)
## Enums
- [Alignment](enums/Alignment.md)
- [ArrayBuilder](enums/ArrayBuilder.md)
- [ArrayBuilder.Component](enums/ArrayBuilder.Component.md)
- [Edge](enums/Edge.md)
- [Icon](enums/Icon.md)
- [Icon.DefaultIcon](enums/Icon.DefaultIcon.md)
- [Transition](enums/Transition.md)
- [ViewBuilder](enums/ViewBuilder.md)
- [ViewBuilder.Component](enums/ViewBuilder.Component.md)
## Extensions
- [ActionRow](extensions/ActionRow.md)
- [App](extensions/App.md)
- [Array](extensions/Array.md)
- [GTUIWindow](extensions/GTUIWindow.md)
- [Libadwaita.FileDialog](extensions/Libadwaita.FileDialog.md)
- [Banner](extensions/Banner.md)
- [Bool](extensions/Bool.md)
- [Button](extensions/Button.md)
- [Carousel](extensions/Carousel.md)
- [Clamp](extensions/Clamp.md)
- [ComboRow](extensions/ComboRow.md)
- [EntryRow](extensions/EntryRow.md)
- [FormSection](extensions/FormSection.md)
- [HeaderBar](extensions/HeaderBar.md)
- [Int](extensions/Int.md)
- [List](extensions/List.md)
- [Menu](extensions/Menu.md)
- [MenuItem](extensions/MenuItem.md)
- [MenuItemGroup](extensions/MenuItemGroup.md)
- [NativeWidgetPeer](extensions/NativeWidgetPeer.md)
- [OpaquePointer](extensions/OpaquePointer.md)
- [OverlaySplitView](extensions/OverlaySplitView.md)
- [PasswordEntryRow](extensions/PasswordEntryRow.md)
- [ProgressBar](extensions/ProgressBar.md)
- [ScrollView](extensions/ScrollView.md)
- [Set](extensions/Set.md)
- [SpinRow](extensions/SpinRow.md)
- [State](extensions/State.md)
- [StatusPage](extensions/StatusPage.md)
- [String](extensions/String.md)
- [SwitchRow](extensions/SwitchRow.md)
- [Text](extensions/Text.md)
- [ToastOverlay](extensions/ToastOverlay.md)
- [Toggle](extensions/Toggle.md)
- [UInt](extensions/UInt.md)
- [UnsafeMutablePointer](extensions/UnsafeMutablePointer.md)
- [UnsafeMutableRawPointer](extensions/UnsafeMutableRawPointer.md)
- [VStack](extensions/VStack.md)
- [View](extensions/View.md)
- [Widget](extensions/Widget.md)
- [WindowScene](extensions/WindowScene.md)
@ -92,16 +141,21 @@
## Typealiases
- [Alignment](typealiases/Alignment.md)
- [Body](typealiases/Body.md)
- [Edge](typealiases/Edge.md)
- [GTUIApplicationWindow](typealiases/GTUIApplicationWindow.md)
- [GTUIWindow](typealiases/GTUIWindow.md)
- [Icon](typealiases/Icon.md)
- [FormSection](typealiases/FormSection.md)
- [List](typealiases/List.md)
- [MenuBuilder](typealiases/MenuBuilder.md)
- [MenuContent](typealiases/MenuContent.md)
- [Scene](typealiases/Scene.md)
- [SceneBuilder](typealiases/SceneBuilder.md)
- [Transition](typealiases/Transition.md)
- [ScrollView](typealiases/ScrollView.md)
- [Text](typealiases/Text.md)
- [Toggle](typealiases/Toggle.md)
- [VStack](typealiases/VStack.md)
## Methods
- [filedialog_on_open_cb(ptr_file_userData_)](methods/filedialog_on_open_cb(ptr_file_userData_).md)
- [filedialog_on_save_cb(ptr_file_userData_)](methods/filedialog_on_save_cb(ptr_file_userData_).md)
This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs)

View File

@ -0,0 +1,30 @@
**CLASS**
# `GTUIAboutWindow`
A GTUI about window.
## Methods
### `init(filePath:)`
Initialize an about window using the AppStream metadata.
- Parameter filePath: The path.
### `generalData(title:icon:developer:version:)`
Set the general data.
- Parameters:
- title: The app name.
- icon: The app icon.
- developer: The app's developer.
- version: The app's version.
### `website(url:)`
Set the website.
- Parameter url: The website.
### `issues(url:)`
Set the URL for issues.
- Parameter issues: The issues website.

View File

@ -13,6 +13,14 @@ The handlers which are called when a state changes.
The app's id for the file name for storing the data.
### `pointer`
The pointer to the application.
### `fields`
Fields for additional information.
### `body`
The app's content.
@ -37,6 +45,19 @@ Initialize the GTUI application.
The entry point of the application.
### `run()`
Run the application.
### `addKeyboardShortcut(_:id:window:handler:)`
Add a keyboard shortcut to the application.
- Parameters:
- shortcut: The keyboard shortcut.
- id: The action's id.
- window: Optionally an application window.
- handler: The action's handler.
### `showWindow(_:)`
Focus the window with a certain id. Create the window if it doesn't already exist.
@ -53,3 +74,7 @@ Add a new window with the content of the window with a certain id.
### `setParentWindows()`
Set the parents of every window having a parent window.
### `quit()`
Terminate the application.

View File

@ -0,0 +1,29 @@
**CLASS**
# `GTUIApplicationWindow`
A GTUI application window.
## Properties
### `app`
The window's parent app.
## Methods
### `init(app:)`
Initialize the application window.
- Parameter app: The application.
### `addKeyboardShortcut(_:id:handler:)`
Add a keyboard shortcut.
- Parameters:
- shortcut: The keyboard shortcut.
- id: The action's id.
- handler: The action's handler.
### `setChild(_:)`
Set the window's child.
- Parameter child: The child.

View File

@ -0,0 +1,77 @@
**CLASS**
# `GTUIFileDialog`
A GTUI file dialog window.
## Properties
### `pointer`
The file dialog's pointer.
### `fields`
Fields for additional data.
### `selfAddr`
A link to the file dialog.
### `parent`
The parent window.
### `isImporter`
Whether the file dialog is an importer.
### `folder`
The selected folder in the file dialog.
### `onResult`
A closure triggered on selecting a file in the dialog.
### `onCancel`
A closure triggered when the dialog is canceled.
## Methods
### `init()`
Initialize the window.
### `setParentWindow(_:)`
Set the window's parent window.
- Parameter parent: The parent window.
### `setInitialName(_:)`
Set the initial name.
- Parameter name: The parent window.
### `setExtensions(_:)`
Set the allowed file extensions.
- Parameters:
- extensions: The file extensions.
### `show()`
Display the file dialog.
### `onOpen(_:)`
Run this when a file gets opened.
- Parameter path: The file path.
### `onSave(_:)`
Run this when a file gets saved.
- Parameter path: The file path.
### `onClose()`
Run this when the user cancels the action.

View File

@ -0,0 +1,69 @@
**CLASS**
# `GTUIWindow`
A GTUI window.
## Properties
### `pointer`
The window's pointer.
### `fields`
Fields for additional information.
## Methods
### `init()`
Initialize the window.
### `init(fields:)`
Initialize the window, but not the pointer.
- Parameter fields: The fields.
### `setDefaultSize(width:height:)`
Set the default window size.
- Parameters:
- width: The width.
- height: The height.
### `setResizability(_:)`
Set the resizability.
- Parameter resizable: Whether the window is resizable.
### `setDeletability(_:)`
Set the deletability.
- Parameter deletable: Whether the window is deletable.
### `setTitle(_:)`
Set the window title.
- Parameter title: The window's title.
### `setChild(_:)`
Set the window's child.
- Parameter child: The child.
### `show()`
Present the window.
### `observeHide(observer:)`
Observe when the window is being closed.
- Parameter observer: The signal closure.
### `close()`
Close the window.
### `setParentWindow(_:)`
Set the window's parent window.
- Parameter parent: The parent window.

View File

@ -17,6 +17,10 @@ The storage key.
The folder path.
### `update`
Whether to update the affected views.
## Methods
### `init(value:)`

View File

@ -0,0 +1,37 @@
**CLASS**
# `ViewStorage.SignalData`
Data to pass to signal handlers.
## Properties
### `closure`
The closure.
### `handler`
The closure as a C handler.
### `threeParamsHandler`
The closure as a C handler with three parameters.
### `fourParamsHandler`
The closure as a C handler with four parameters.
### `fiveParamsHandler`
The closure as a C handler with five parameters.
## Methods
### `init(closure:)`
Initialize the signal data.
- Parameter closure: The signal's closure.
### `init(closure:)`
Initialize the signal data.
- Parameter closure: The signal's closure.

View File

@ -5,9 +5,9 @@
Store a rendered view in a view storage.
## Properties
### `view`
### `pointer`
The GTUI widget.
The pointer.
### `content`
@ -17,11 +17,60 @@ The view's content.
The view's state (used in `StateWrapper`).
### `handlers`
The signal handlers.
### `fields`
Other properties.
## Methods
### `init(_:content:state:)`
Initialize a view storage.
- Parameters:
- view: The GTUI widget.
- pointer: The pointer to the Gtk widget.
- content: The view's content.
- state: The view's state.
### `notify(name:id:connectFlags:handler:)`
Connect a handler to the observer of a property.
- Parameters:
- name: The property's name.
- id: The handlers id to separate form others connecting to the signal.
- connectFlags: The GConnectFlags.
- handler: The signal's handler.
### `connectSignal(name:id:connectFlags:argCount:handler:)`
Connect a handler to a signal.
- Parameters:
- name: The signal's name.
- id: The handlers id to separate form others connecting to the signal.
- connectFlags: The GConnectFlags.
- argCount: The number of additional arguments (without the first and the last one).
- handler: The signal's handler.
### `connectSignal(name:id:connectFlags:argCount:handler:)`
Connect a handler to a signal.
- Parameters:
- name: The signal's name.
- id: The handlers id to separate form others connecting to the signal.
- connectFlags: The GConnectFlags.
- argCount: The number of additional arguments (without the first and the last one).
- handler: The signal's handler.
### `modify(_:)`
Modify the view.
- Parameter modify: The modification function.
### `modify(_:_:)`
Convert the pointer to a pointer of a certain type and modify the view.
- Parameters:
- type: The pointer's type.
- modify: The modification function.

View File

@ -0,0 +1,35 @@
**ENUM**
# `Alignment`
The alignment for a widget.
## Cases
### `fill`
The widget will fill the available space.
### `start`
The widget will start at the beginning of the available space.
### `end`
The widget will end at the end of the available space.
### `center`
The widget will be centered in the available space.
### `baselineFill`
The widget will be baseline aligned in the available space.
### `baselineCenter`
The widget will be baseline aligned at the start of the available space.
## Properties
### `cAlign`
Get the GtkAlign alignment.

View File

@ -0,0 +1,22 @@
**ENUM**
# `Edge`
The edges for a widget.
## Cases
### `leading`
The leading (start) edge.
### `trailing`
The trailing (end) edge.
### `top`
The top edge.
### `bottom`
The bottom edge.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
**ENUM**
# `Icon`
An icon.
## Cases
### `default(icon:)`
A preinstalled icon.
- Parameter icon: The default icon.
### `custom(name:)`
A custom icon.
- Parameter name: The icon's name.
## Properties
### `string`
A string representation of the icon.

View File

@ -0,0 +1,25 @@
**ENUM**
# `Transition`
A transition for a stack.
## Cases
### `none`
### `crossfade`
### `slideRight`
### `coverUp`
### `uncoverUp`
### `coverUpDown`
### `rotateLeft`
## Properties
### `cTransition`
Get the GtkStackTransitionType transition.

View File

@ -0,0 +1,9 @@
**EXTENSION**
# `ActionRow`
## Methods
### `init(_:)`
Initialize an action row.
- Parameter title: The row's title.

View File

@ -7,6 +7,10 @@
The array's view body is the array itself.
### `cArray`
Get the C version of the array.
## Methods
### `widget(modifiers:)`
@ -14,12 +18,13 @@ Get a widget from a collection of views.
- Parameter modifiers: Modify views before being updated.
- Returns: A widget.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update a collection of views with a collection of view storages.
- Parameters:
- storage: The collection of view storages.
- modifiers: Modify views before being updated.
- updateProperties: Whether to update properties.
### `windows()`

View File

@ -0,0 +1,19 @@
**EXTENSION**
# `Banner`
## Methods
### `init(_:visible:)`
Initialize a text widget.
- Parameters:
- title: The content.
- visible: Whether the banner is visible.
### `button(_:handler:)`
Configure the banner's button.
- Parameters:
- label: The button's title.
- handler: The button's handler.
- Returns: The banner.

View File

@ -0,0 +1,8 @@
**EXTENSION**
# `Bool`
## Properties
### `cBool`
Get the gboolean for C.

View File

@ -0,0 +1,39 @@
**EXTENSION**
# `Button`
## Methods
### `init(_:icon:handler:)`
Initialize a button.
- Parameters:
- label: The button's label.
- icon: The button's icon.
- handler: The button's action handler.
### `init(_:handler:)`
Initialize a button.
- Parameters:
- label: The buttons label.
- handler: The button's action handler.
### `keyboardShortcut(_:window:)`
Create a keyboard shortcut for an application window from a button.
Note that the keyboard shortcut is available after the view has been visible for the first time.
- Parameters:
- shortcut: The keyboard shortcut.
- window: The application window.
- Returns: The button.
### `keyboardShortcut(_:app:)`
Create a keyboard shortcut for an application from a button.
Note that the keyboard shortcut is available after the view has been visible for the first time.
- Parameters:
- shortcut: The keyboard shortcut.
- window: The application.
- Returns: The button.

View File

@ -0,0 +1,10 @@
**EXTENSION**
# `Carousel`
## Methods
### `longSwipes(_:)`
Set whether long swipes are allowed or not.
- Parameter longSwipes: Whether long swipes are allowed.
- Returns: The carousel.

View File

@ -0,0 +1,9 @@
**EXTENSION**
# `Clamp`
## Methods
### `init(vertical:)`
Initialize either a horizontal or vertical clamp.
- Parameter vertical: Whether it is a vertical clamp.

View File

@ -0,0 +1,17 @@
**EXTENSION**
# `ComboRow`
## Properties
### `values`
### `stringList`
## Methods
### `init(_:selection:values:)`
Initialize a combo row.
- Parameters:
- title: The row's title.
- selection: The selected value.
- values: The available values.

View File

@ -0,0 +1,26 @@
**EXTENSION**
# `EntryRow`
## Properties
### `textField`
## Methods
### `init(_:text:)`
Initialize an entry row.
- Parameters:
- title: The row's title.
- text: The text.
### `onSubmit(_:)`
Set the entry row's subtitle.
- Parameter subtitle: The subtitle.
- Returns: The entry row.
### `secure(text:)`
Let the user securely enter private text.
- Parameter: The text.
- Returns: The entry row.

View File

@ -0,0 +1,17 @@
**EXTENSION**
# `FormSection`
## Methods
### `init(_:content:)`
Initialize a form section.
- Parameters:
- title: The title.
- content: The content, usually one or more forms.
### `suffix(_:)`
Set the form section's suffix view.
- Parameter suffix: The suffix.
- Returns: The form section.

View File

@ -0,0 +1,35 @@
**EXTENSION**
# `HeaderBar`
## Methods
### `init(titleButtons:start:end:)`
Initialize a header bar.
- Parameters:
- titleButtons: Whether the title buttons (e.g. close button) are visible.
- start: The start content.
- end: The end content.
### `empty()`
Initialize an empty header bar.
- Returns: The header bar.
### `start(start:)`
Initialize a header bar with only views at the start.
- Parameter start: The views.
- Returns: The header bar.
### `end(end:)`
Initialize a header bar with only views at the end.
- Parameter start: The views.
- Returns: The header bar.
### `headerBarTitle(view:)`
Set the title widget for the header bar.
- Parameter view: The widget in the header bar.
- Returns: The header bar.

View File

@ -0,0 +1,12 @@
**EXTENSION**
# `Int`
## Properties
### `id`
Get the integer itself as the identifier.
### `cInt`
The C integer.

View File

@ -0,0 +1,25 @@
**EXTENSION**
# `List`
## Properties
### `selectionField`
The ID for the field storing the selection value.
### `elementsField`
The ID for the field storing the elements.
## Methods
### `init(_:selection:content:)`
Initialize `List`.
- Parameters:
- elements: The elements.
- selection: The identifier of the selected element. Selection disabled if `nil`.
- content: The view for an element.
### `sidebarStyle()`
Add the "navigation-sidebar" style class.

View File

@ -0,0 +1,23 @@
**EXTENSION**
# `Menu`
## Methods
### `init(_:icon:app:window:content:)`
Initialize a menu button.
- Parameters:
- label: The button's label.
- icon: The button's icon.
- app: The application.
- window: The application window.
- content: The menu's content.
### `init(_:app:window:content:)`
Initialize a menu button.
- Parameters:
- label: The buttons label.
- app: The application.
- window: The application window.
- content: The menu's content.

View File

@ -0,0 +1,9 @@
**EXTENSION**
# `OpaquePointer`
## Methods
### `cast()`
Convert an opaque pointer into an unsafe mutable pointer with a defined type.
- Returns: The unsafe mutable pointer.

View File

@ -0,0 +1,18 @@
**EXTENSION**
# `OverlaySplitView`
## Methods
### `init(visible:sidebar:content:)`
Initialize an overlay split view.
- Parameters:
- visible: Whether the sidebar is visible.
- sidebar: The sidebar content.
- content: The main content.
### `trailingSidebar(_:)`
The position of the sidebar.
- Parameter trailing: Whether the sidebar is at the trailing position.
- Returns: The navigation split view.

View File

@ -0,0 +1,20 @@
**EXTENSION**
# `PasswordEntryRow`
## Properties
### `textField`
## Methods
### `init(_:text:)`
Initialize an entry row.
- Parameters:
- title: The row's title.
- text: The text.
### `onSubmit(_:)`
Set the entry row's subtitle.
- Parameter subtitle: The subtitle.
- Returns: The entry row.

View File

@ -0,0 +1,11 @@
**EXTENSION**
# `ProgressBar`
## Methods
### `init(value:total:)`
Initialize a progress bar widget.
- Parameters:
- value: The value.
- total: The maximum value.

View File

@ -0,0 +1,9 @@
**EXTENSION**
# `ScrollView`
## Methods
### `init(content:)`
Initialize a `ScrollView`.
- Parameter content: The view content.

View File

@ -0,0 +1,39 @@
**EXTENSION**
# `Set`
## Properties
### `all`
Horizontal and vertical edges.
### `vertical`
Top and bottom edges.
### `horizontal`
Leading and trailing edges.
### `top`
Top edge.
### `bottom`
Bottom edge.
### `leading`
Leading edge.
### `trailing`
Trailing edge.
## Methods
### `add(_:)`
Add a collection of edges to a collection of edges.
- Parameter edges: The collection of edges.
- Returns: Both collections combined.

View File

@ -0,0 +1,34 @@
**EXTENSION**
# `SpinRow`
## Methods
### `init(_:value:min:max:)`
Initialize a spin row.
- Parameters:
- title: The row's title.
- value: The selected value.
- min: The minimum value.
- max: The maximum value.
### `init(_:value:min:max:)`
Initialize a spin row.
- Parameters:
- title: The row's title.
- value: The selected value.
- min: The minimum value.
- max: The maximum value.
### `step(_:)`
Set the difference a single click on the increase/decrease buttons makes.
- Parameter step: The increase/decrease step.
- Returns: The spin row.
### `step(_:)`
Set the difference a single click on the increase/decrease buttons makes.
- Parameter step: The increase/decrease step.
- Returns: The spin row.

View File

@ -3,13 +3,14 @@
# `State`
## Methods
### `init(wrappedValue:_:folder:)`
### `init(wrappedValue:_:folder:forceUpdates:)`
Initialize a property representing a state in the view.
- Parameters:
- wrappedValue: The wrapped value.
- key: The unique storage key of the property.
- folder: The path to the folder containing the JSON file.
- forceUpdates: Whether to force update all available views when the property gets modified.
The folder path will be appended to the XDG data home directory.

View File

@ -0,0 +1,13 @@
**EXTENSION**
# `StatusPage`
## Methods
### `init(_:icon:description:content:)`
Initialize a status page widget.
- Parameters:
- title: The title.
- icon: The icon.
- description: Additional details.
- content: Additional content.

View File

@ -14,3 +14,34 @@ A label for the transition data in a GTUI widget's fields.
### `navigationLabel`
A label for the navigation label in a GTUI widget's fields.
## Methods
### `ctrl()`
Add the Ctrl key to a shortcut.
- Returns: The shortcut.
### `shift()`
Add the Shift key to a shortcut.
- Returns: The shortcut.
### `alt()`
Add the Alt key to a shortcut.
- Returns: The shortcut.
### `meta()`
Add the Meta key to a shortcut.
- Returns: The shortcut.
### `super()`
Add the Super key to a shortcut.
- Returns: The shortcut.
### `hyper()`
Add the Hyper key to a shortcut.
- Returns: The shortcut.

View File

@ -0,0 +1,11 @@
**EXTENSION**
# `SwitchRow`
## Methods
### `init(_:isOn:)`
Initialize a switch row.
- Parameters:
- title: The row's title.
- isOn: Whether the switch is on.

View File

@ -0,0 +1,9 @@
**EXTENSION**
# `Text`
## Methods
### `init(_:)`
Initialize a text widget.
- Parameter text: The content.

View File

@ -0,0 +1,19 @@
**EXTENSION**
# `ToastOverlay`
## Methods
### `init(_:signal:)`
Initialize a toast overlay.
- Parameters:
- title: The toast's title.
- signal: The signal for adding a toast.
### `action(button:handler:)`
Add an action button to the toast.
- Parameters:
- button: The button's label.
- handler: The handler.
- Returns: The toast overlay.

View File

@ -0,0 +1,24 @@
**EXTENSION**
# `Toggle`
## Methods
### `init(_:icon:isOn:)`
Initialize a toggle button.
- Parameters:
- label: The button's label.
- icon: The button's icon.
- isOn: Whether the toggle is on.
### `init(_:isOn:)`
Initialize a toggle button.
- Parameters:
- label: The buttons label.
- isOn: Whether the toggle is on.
### `checkButton()`
Use the check button style.
- Returns: The toggle.

View File

@ -0,0 +1,8 @@
**EXTENSION**
# `UInt`
## Properties
### `cInt`
Convert an unsigned integer into the C form.

View File

@ -0,0 +1,14 @@
**EXTENSION**
# `UnsafeMutablePointer`
## Methods
### `opaque()`
Convert into an opaque pointer.
- Returns: The opaque pointer.
### `cast()`
Convert into an unsafe mutable pointer of another type.
- Returns: The unsafe mutable pointer.

View File

@ -0,0 +1,9 @@
**EXTENSION**
# `UnsafeMutableRawPointer`
## Methods
### `cast()`
Convert into an unsafe mutable pointer of a certain type.
- Returns: The unsafe mutable pointer.

View File

@ -0,0 +1,11 @@
**EXTENSION**
# `VStack`
## Methods
### `init(content:)`
Initialize a `VStack`.
- Parameter content: The view content.
### `init(horizontal:content:)`

View File

@ -9,12 +9,15 @@ Wrap the view into a widget.
- Parameter modifiers: Modify views before being updated.
- Returns: The widget.
### `updateStorage(_:modifiers:)`
### `updateStorage(_:modifiers:updateProperties:)`
Update a storage to a view.
- Parameters:
- storage: The storage.
- modifiers: Modify views before being updated.
- updateProperties: Whether to update properties.
### `getState()`
### `storage(modifiers:)`
@ -44,8 +47,20 @@ Run a function when the widget gets clicked.
### `frame(maxSize:)`
Set the view's maximal size.
- Parameter maxSize: The maximal size.
Set the view's maximum width.
- Parameter maxSize: The maximum width.
- Returns: A view.
### `frame(maxWidth:)`
Set the view's maximum width.
- Parameter maxWidth: The maximum width.
- Returns: A view.
### `frame(maxHeight:)`
Set the view's maximum height.
- Parameter maxHeight: The maximum height.
- Returns: A view.
### `modifyContent(_:modify:)`
@ -137,13 +152,6 @@ Make the view insensitive (useful e.g. in overlays).
Remove all of the content modifiers for the wrapped views.
- Returns: A view.
### `overlay(_:)`
Add an overlay view.
- Parameters:
- overlay: The overlay view.
- Returns: A view.
### `toast(_:signal:)`
Present a toast when the signal gets activated.
@ -162,6 +170,16 @@ Present a toast with a button when the signal gets activated.
- handler: The handler for the button.
- Returns: A view.
### `verticalCenter()`
Wrap the view in a vertical stack and center vertically.
- Returns: The view.
### `horizontalCenter()`
Wrap the view in a horizontal stack and center horizontally.
- Returns: The view.
### `topToolbar(visible:_:)`
Add a top toolbar to the view.
@ -178,7 +196,9 @@ Add a bottom toolbar to the view.
- visible: Whether the toolbar is visible.
- Returns: A view.
### `verticalCenter()`
### `overlay(_:)`
Wrap the view in a vertical stack and center vertically.
- Returns: The view.
Add an overlay view.
- Parameters:
- overlay: The overlay view.
- Returns: A view.

View File

@ -8,9 +8,10 @@
Get the windows described by the group.
- Returns: The windows.
### `update(_:app:)`
### `update(_:app:force:)`
Update the windows described by the group.
- Parameters:
- storage: The window's storage.
- app: The application.
- force: Whether to force update all the views.

View File

@ -0,0 +1,7 @@
### `filedialog_on_open_cb(ptr:file:userData:)`
Run when a file should be opened.
- Parameters:
- ptr: The pointer.
- file: The path to the file.
- userData: The file dialog data.

View File

@ -0,0 +1,7 @@
### `filedialog_on_save_cb(ptr:file:userData:)`
Run when a file should be saved.
- Parameters:
- ptr: The pointer.
- file: The path to the file.
- userData: The file dialog data.

View File

@ -10,9 +10,10 @@ A widget is a view that know about its GTUI widget.
The view storage.
- Parameter modifiers: Modify views before being updated.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the stored content.
- Parameters:
- storage: The storage to update.
- modifiers: Modify views before being updated
- updateProperties: Whether to update the view's properties.

View File

@ -28,9 +28,10 @@ Get the storage for the window.
- Parameter app: The application.
- Returns: The storage.
### `update(_:app:)`
### `update(_:app:force:)`
Update a window storage's content.
- Parameters:
- storage: The storage to update.
- app: The application.
- force: Whether to force update all the views.

View File

@ -41,6 +41,10 @@ The app icon.
The app's website.
### `path`
The path to the app data file.
## Methods
### `init(id:appName:developer:version:)`
@ -51,6 +55,13 @@ Create a window type with a certain identifier and content.
- developer: The developer's name.
- version: The app version.
### `init(id:path:)`
Create a window type with a certain identifier and content.
- Parameters:
- id: The identifier.
- path: The path to the app data file.
### `icon(_:)`
Set the app icon.
@ -75,12 +86,13 @@ Get the window.
- Parameter app: The application.
- Returns: The window.
### `update(_:app:)`
### `update(_:app:force:)`
Update a window.
- Parameters:
- storage: The storage to update.
- app: The application.
- force: Whether to force update all the views.
### `updateData(window:)`

View File

@ -2,71 +2,232 @@
# `ActionRow`
A form content row showing a title and optionally a subtitle and widgets.
A [class@Gtk.ListBoxRow] used to present actions.
<picture><source srcset="action-row-dark.png" media="(prefers-color-scheme: dark)"><img src="action-row.png" alt="action-row"></picture>
The `AdwActionRow` widget can have a title, a subtitle and an icon. The row
can receive additional widgets at its end, or prefix widgets at its start.
It is convenient to present a preference and its related actions.
`AdwActionRow` is unactivatable by default, giving it an activatable widget
will automatically make it activatable, but unsetting it won't change the
row's activatability.
## AdwActionRow as GtkBuildable
The `AdwActionRow` implementation of the [iface@Gtk.Buildable] interface
supports adding a child at its end by specifying “suffix” or omitting the
“type” attribute of a <child> element.
It also supports adding a child as a prefix widget by specifying “prefix” as
the “type” attribute of a <child> element.
## CSS nodes
`AdwActionRow` has a main CSS node with name `row`.
It contains the subnode `box.header` for its main horizontal box, and
`box.title` for the vertical box containing the title and subtitle labels.
It contains subnodes `label.title` and `label.subtitle` representing
respectively the title label and subtitle label.
## Properties
### `title`
### `updateFunctions`
The title.
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `activatableWidget`
The widget to activate when the row is activated.
The row can be activated either by clicking on it, calling
[method@ActionRow.activate], or via mnemonics in the title.
See the [property@PreferencesRow:use-underline] property to enable
mnemonics.
The target widget will be activated by emitting the
[signal@Gtk.Widget::mnemonic-activate] signal on it.
### `iconName`
The icon name for this row.
### `subtitle`
The subtitle.
The subtitle for this row.
### `prefix`
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
The prefix.
### `subtitleLines`
The number of lines at the end of which the subtitle label will be
ellipsized.
If the value is 0, the number of lines won't be limited.
### `subtitleSelectable`
Whether the user can copy the subtitle from the label.
See also [property@Gtk.Label:selectable].
### `titleLines`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `activated`
This signal is emitted after the row has been activated.
### `suffix`
The suffix.
The body for the widget "suffix".
### `prefixID`
### `prefix`
The identifier for the prefix content.
The body for the widget "prefix".
### `suffixID`
### `app`
The identifier for the suffix content.
The application.
### `window`
The window.
## Methods
### `init(_:)`
### `init()`
Initialize an action row.
- Parameter title: The row's title.
### `update(_:modifiers:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `ActionRow`.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(row:)`
### `update(_:modifiers:updateProperties:)`
Update the action row.
- Parameter row: The action row.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `activatableWidget(_:)`
The widget to activate when the row is activated.
The row can be activated either by clicking on it, calling
[method@ActionRow.activate], or via mnemonics in the title.
See the [property@PreferencesRow:use-underline] property to enable
mnemonics.
The target widget will be activated by emitting the
[signal@Gtk.Widget::mnemonic-activate] signal on it.
### `iconName(_:)`
The icon name for this row.
### `subtitle(_:)`
Set the action row's subtitle.
- Parameter subtitle: The subtitle.
- Returns: The action row.
The subtitle for this row.
### `prefix(_:)`
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
Set the action row's prefix view.
- Parameter prefix: The prefix.
- Returns: The action row.
### `subtitleLines(_:)`
The number of lines at the end of which the subtitle label will be
ellipsized.
If the value is 0, the number of lines won't be limited.
### `subtitleSelectable(_:)`
Whether the user can copy the subtitle from the label.
See also [property@Gtk.Label:selectable].
### `titleLines(_:)`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title(_:)`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable(_:)`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup(_:)`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.
### `activated(_:)`
This signal is emitted after the row has been activated.
### `suffix(_:)`
Set the action row's suffix view.
- Parameter suffix: The suffix.
- Returns: The action row.
Set the body for "suffix".
- Parameter body: The body.
- Returns: The widget.
### `prefix(_:)`
Set the body for "prefix".
- Parameter body: The body.
- Returns: The widget.

View File

@ -20,9 +20,10 @@ Get the content's container.
- Parameter modifiers: Modify views before being updated.
- Returns: The content's container.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the content.
- Parameters:
- storage: The content's storage.
- modifiers: Modify views before being updated.
- updateProperties: Whether to update properties.

View File

@ -0,0 +1,106 @@
**STRUCT**
# `Avatar`
A widget displaying an image, with a generated fallback.
<picture><source srcset="avatar-dark.png" media="(prefers-color-scheme: dark)"><img src="avatar.png" alt="avatar"></picture>
`AdwAvatar` is a widget that shows a round avatar.
`AdwAvatar` generates an avatar with the initials of the
[property@Avatar:text] on top of a colored background.
The color is picked based on the hash of the [property@Avatar:text].
If [property@Avatar:show-initials] is set to `FALSE`,
[property@Avatar:icon-name] or `avatar-default-symbolic` is shown instead of
the initials.
Use [property@Avatar:custom-image] to set a custom image.
## CSS nodes
`AdwAvatar` has a single CSS node with name `avatar`.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `iconName`
The name of an icon to use as a fallback.
If no name is set, `avatar-default-symbolic` will be used.
### `showInitials`
Whether initials are used instead of an icon on the fallback avatar.
See [property@Avatar:icon-name] for how to change the fallback icon.
### `size`
The size of the avatar.
### `text`
Sets the text used to generate the fallback initials and color.
It's only used to generate the color if [property@Avatar:show-initials] is
`FALSE`.
### `app`
The application.
### `window`
The window.
## Methods
### `init(showInitials:size:)`
Initialize `Avatar`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `iconName(_:)`
The name of an icon to use as a fallback.
If no name is set, `avatar-default-symbolic` will be used.
### `showInitials(_:)`
Whether initials are used instead of an icon on the fallback avatar.
See [property@Avatar:icon-name] for how to change the fallback icon.
### `size(_:)`
The size of the avatar.
### `text(_:)`
Sets the text used to generate the fallback initials and color.
It's only used to generate the color if [property@Avatar:show-initials] is
`FALSE`.

View File

@ -2,54 +2,120 @@
# `Banner`
A banner widget.
A bar with contextual information.
<picture><source srcset="banner-dark.png" media="(prefers-color-scheme: dark)"><img src="banner.png" alt="banner"></picture>
Banners are hidden by default, use [property@Banner:revealed] to show them.
Banners have a title, set with [property@Banner:title]. Titles can be marked
up with Pango markup, use [property@Banner:use-markup] to enable it.
The title will be shown centered or left-aligned depending on available
space.
Banners can optionally have a button with text on it, set through
[property@Banner:button-label]. The button can be used with a `GAction`,
or with the [signal@Banner::button-clicked] signal.
## CSS nodes
`AdwBanner` has a main CSS node with the name `banner`.
## Properties
### `title`
### `updateFunctions`
The content.
Additional update functions for type extensions.
### `visible`
### `appearFunctions`
Whether the banner is visible.
Additional appear functions for type extensions.
### `buttonLabel`
The button's label.
The label to show on the button.
### `handler`
If set to `""` or `NULL`, the button won't be shown.
The button's handler.
The button can be used with a `GAction`, or with the
[signal@Banner::button-clicked] signal.
### `revealed`
Whether the banner is currently revealed.
### `title`
The title for this banner.
See also: [property@Banner:use-markup].
### `useMarkup`
Whether to use Pango markup for the banner title.
See also [func@Pango.parse_markup].
### `buttonClicked`
This signal is emitted after the action button has been clicked.
It can be used as an alternative to setting an action.
### `app`
The application.
### `window`
The window.
## Methods
### `init(_:visible:)`
### `init(title:)`
Initialize a text widget.
- Parameters:
- title: The content.
- visible: Whether the banner is visible.
### `update(_:modifiers:)`
Update the view storage of the text widget.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `Banner`.
### `container(modifiers:)`
Get the container of the text widget.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(banner:)`
### `update(_:modifiers:updateProperties:)`
Update the banner.
- Parameter banner: The banner.
### `button(_:handler:)`
Configure the banner's button.
Update the widget's view storage.
- Parameters:
- label: The button's title.
- handler: The button's handler.
- Returns: The banner.
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `buttonLabel(_:)`
The label to show on the button.
If set to `""` or `NULL`, the button won't be shown.
The button can be used with a `GAction`, or with the
[signal@Banner::button-clicked] signal.
### `revealed(_:)`
Whether the banner is currently revealed.
### `title(_:)`
The title for this banner.
See also: [property@Banner:use-markup].
### `useMarkup(_:)`
Whether to use Pango markup for the banner title.
See also [func@Pango.parse_markup].
### `buttonClicked(_:)`
This signal is emitted after the action button has been clicked.
It can be used as an alternative to setting an action.

View File

@ -0,0 +1,57 @@
**STRUCT**
# `Bin`
A widget with one child.
<picture><source srcset="bin-dark.png" media="(prefers-color-scheme: dark)"><img src="bin.png" alt="bin"></picture>
The `AdwBin` widget has only one child, set with the [property@Bin:child]
property.
It is useful for deriving subclasses, since it provides common code needed
for handling a single child widget.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `child`
The child widget of the `AdwBin`.
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `Bin`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `child(_:)`
The child widget of the `AdwBin`.

View File

@ -0,0 +1,118 @@
**STRUCT**
# `Box`
The `GtkBox` widget arranges child widgets into a single row or column.
![An example GtkBox](box.png)
Whether it is a row or column depends on the value of its
[property@Gtk.Orientable:orientation] property. Within the other
dimension, all children are allocated the same size. Of course, the
[property@Gtk.Widget:halign] and [property@Gtk.Widget:valign] properties
can be used on the children to influence their allocation.
Use repeated calls to [method@Gtk.Box.append] to pack widgets into a
`GtkBox` from start to end. Use [method@Gtk.Box.remove] to remove widgets
from the `GtkBox`. [method@Gtk.Box.insert_child_after] can be used to add
a child at a particular position.
Use [method@Gtk.Box.set_homogeneous] to specify whether or not all children
of the `GtkBox` are forced to get the same amount of space.
Use [method@Gtk.Box.set_spacing] to determine how much space will be minimally
placed between all children in the `GtkBox`. Note that spacing is added
*between* the children.
Use [method@Gtk.Box.reorder_child_after] to move a child to a different
place in the box.
# CSS nodes
`GtkBox` uses a single CSS node with name box.
# Accessibility
Until GTK 4.10, `GtkBox` used the `GTK_ACCESSIBLE_ROLE_GROUP` role.
Starting from GTK 4.12, `GtkBox` uses the `GTK_ACCESSIBLE_ROLE_GENERIC` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `baselineChild`
The child that determines the baseline, in vertical orientation.
### `homogeneous`
Whether the children should all be the same size.
### `spacing`
The amount of space between children.
### `append`
The body for the widget "append".
### `prepend`
The body for the widget "prepend".
### `app`
The application.
### `window`
The window.
## Methods
### `init(spacing:)`
Initialize `Box`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `baselineChild(_:)`
The child that determines the baseline, in vertical orientation.
### `homogeneous(_:)`
Whether the children should all be the same size.
### `spacing(_:)`
The amount of space between children.
### `append(_:)`
Set the body for "append".
- Parameter body: The body.
- Returns: The widget.
### `prepend(_:)`
Set the body for "prepend".
- Parameter body: The body.
- Returns: The widget.

View File

@ -2,66 +2,159 @@
# `Button`
A button widget.
The `GtkButton` widget is generally used to trigger a callback function that is
called when the button is pressed.
![An example GtkButton](button.png)
The `GtkButton` widget can hold any valid child widget. That is, it can hold
almost any other standard `GtkWidget`. The most commonly used child is the
`GtkLabel`.
# CSS nodes
`GtkButton` has a single CSS node with name button. The node will get the
style classes .image-button or .text-button, if the content is just an
image or label, respectively. It may also receive the .flat style class.
When activating a button via the keyboard, the button will temporarily
gain the .keyboard-activating style class.
Other style classes that are commonly used with `GtkButton` include
.suggested-action and .destructive-action. In special cases, buttons
can be made round by adding the .circular style class.
Button-like widgets like [class@Gtk.ToggleButton], [class@Gtk.MenuButton],
[class@Gtk.VolumeButton], [class@Gtk.LockButton], [class@Gtk.ColorButton]
or [class@Gtk.FontButton] use style classes such as .toggle, .popup, .scale,
.lock, .color on the button node to differentiate themselves from a plain
`GtkButton`.
# Accessibility
`GtkButton` uses the %GTK_ACCESSIBLE_ROLE_BUTTON role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `canShrink`
Whether the size of the button can be made smaller than the natural
size of its contents.
For text buttons, setting this property will allow ellipsizing the label.
If the contents of a button are an icon or a custom widget, setting this
property has no effect.
### `child`
The child widget.
### `hasFrame`
Whether the button has a frame.
### `iconName`
The name of the icon used to automatically populate the button.
### `label`
The button's label.
Text of the label inside the button, if the button contains a label widget.
### `icon`
### `useUnderline`
The button's icon.
If set, an underline in the text indicates that the following character is
to be used as mnemonic.
### `handler`
### `activate`
The button's action handler.
Emitted to animate press then release.
This is an action signal. Applications should never connect
to this signal, but use the [signal@Gtk.Button::clicked] signal.
The default bindings for this signal are all forms of the
<kbd></kbd> and <kbd>Enter</kbd> keys.
### `clicked`
Emitted when the button has been activated (pressed and released).
### `app`
The application.
### `window`
The window.
## Methods
### `init(_:icon:handler:)`
### `init()`
Initialize a button.
- Parameters:
- label: The button's label.
- icon: The button's icon.
- handler: The button's action handler.
### `init(_:handler:)`
Initialize a button.
- Parameters:
- label: The buttons label.
- handler: The button's action handler.
### `update(_:modifiers:)`
Update a button's view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `Button`.
### `container(modifiers:)`
Get a button's view storage.
- Parameter modifiers: Modify views before being updated.
- Returns: The button's view storage.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `keyboardShortcut(_:window:)`
### `update(_:modifiers:updateProperties:)`
Create a keyboard shortcut for an application window from a button.
Note that the keyboard shortcut is available after the view has been visible for the first time.
Update the widget's view storage.
- Parameters:
- shortcut: The keyboard shortcut.
- window: The application window.
- Returns: The button.
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `keyboardShortcut(_:app:)`
### `canShrink(_:)`
Create a keyboard shortcut for an application from a button.
Whether the size of the button can be made smaller than the natural
size of its contents.
Note that the keyboard shortcut is available after the view has been visible for the first time.
- Parameters:
- shortcut: The keyboard shortcut.
- window: The application.
- Returns: The button.
For text buttons, setting this property will allow ellipsizing the label.
If the contents of a button are an icon or a custom widget, setting this
property has no effect.
### `child(_:)`
The child widget.
### `hasFrame(_:)`
Whether the button has a frame.
### `iconName(_:)`
The name of the icon used to automatically populate the button.
### `label(_:)`
Text of the label inside the button, if the button contains a label widget.
### `useUnderline(_:)`
If set, an underline in the text indicates that the following character is
to be used as mnemonic.
### `activate(_:)`
Emitted to animate press then release.
This is an action signal. Applications should never connect
to this signal, but use the [signal@Gtk.Button::clicked] signal.
The default bindings for this signal are all forms of the
<kbd></kbd> and <kbd>Enter</kbd> keys.
### `clicked(_:)`
Emitted when the button has been activated (pressed and released).

View File

@ -0,0 +1,127 @@
**STRUCT**
# `ButtonContent`
A helper widget for creating buttons.
<picture><source srcset="button-content-dark.png" media="(prefers-color-scheme: dark)"><img src="button-content.png" alt="button-content"></picture>
`AdwButtonContent` is a box-like widget with an icon and a label.
It's intended to be used as a direct child of [class@Gtk.Button],
[class@Gtk.MenuButton] or [class@SplitButton], when they need to have both an
icon and a label, as follows:
```xml
<object class="GtkButton"><property name="child"><object class="AdwButtonContent"><property name="icon-name">document-open-symbolic</property><property name="label" translatable="yes">_Open</property><property name="use-underline">True</property></object></property></object>
```
`AdwButtonContent` handles style classes and connecting the mnemonic to the
button automatically.
## CSS nodes
```
buttoncontent
├── image
╰── label
```
`AdwButtonContent`'s CSS node is called `buttoncontent`. It contains the
subnodes `image` and `label`.
When inside a `GtkButton` or `AdwSplitButton`, the button will receive the
`.image-text-button` style class. When inside a `GtkMenuButton`, the
internal `GtkButton` will receive it instead.
## Accessibility
`AdwButtonContent` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `canShrink`
Whether the button can be smaller than the natural size of its contents.
If set to `TRUE`, the label will ellipsize.
See [property@Gtk.Button:can-shrink].
### `iconName`
The name of the displayed icon.
If empty, the icon is not shown.
### `label`
The displayed label.
### `useUnderline`
Whether an underline in the text indicates a mnemonic.
The mnemonic can be used to activate the parent button.
See [property@ButtonContent:label].
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `ButtonContent`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `canShrink(_:)`
Whether the button can be smaller than the natural size of its contents.
If set to `TRUE`, the label will ellipsize.
See [property@Gtk.Button:can-shrink].
### `iconName(_:)`
The name of the displayed icon.
If empty, the icon is not shown.
### `label(_:)`
The displayed label.
### `useUnderline(_:)`
Whether an underline in the text indicates a mnemonic.
The mnemonic can be used to activate the parent button.
See [property@ButtonContent:label].

View File

@ -2,35 +2,154 @@
# `Carousel`
A carousel view.
A paginated scrolling widget.
<picture><source srcset="carousel-dark.png" media="(prefers-color-scheme: dark)"><img src="carousel.png" alt="carousel"></picture>
The `AdwCarousel` widget can be used to display a set of pages with
swipe-based navigation between them.
[class@CarouselIndicatorDots] and [class@CarouselIndicatorLines] can be used
to provide page indicators for `AdwCarousel`.
## CSS nodes
`AdwCarousel` has a single CSS node with name `carousel`.
## Properties
### `elements`
### `updateFunctions`
The elements.
Additional update functions for type extensions.
### `content`
### `appearFunctions`
The content.
Additional appear functions for type extensions.
### `allowLongSwipes`
Whether long swipes are allowed.
Whether to allow swiping for more than one page at a time.
### `view`
If the value is `FALSE`, each swipe can only move to the adjacent pages.
The view.
### `allowMouseDrag`
Sets whether the `AdwCarousel` can be dragged with mouse pointer.
If the value is `FALSE`, dragging is only available on touch.
### `allowScrollWheel`
Whether the widget will respond to scroll wheel events.
If the value is `FALSE`, wheel events will be ignored.
### `interactive`
Whether the carousel can be navigated.
This can be used to temporarily disable the carousel to only allow
navigating it in a certain state.
### `nPages`
The number of pages in a `AdwCarousel`.
### `revealDuration`
Page reveal duration, in milliseconds.
Reveal duration is used when animating adding or removing pages.
### `spacing`
Spacing between pages in pixels.
### `pageChanged`
This signal is emitted after a page has been changed.
It can be used to implement "infinite scrolling" by amending the pages
after every scroll. Note that an empty carousel is indicated by
`(int)index == -1`.
### `elements`
The dynamic widget elements.
### `content`
The dynamic widget content.
### `app`
The application.
### `window`
The window.
## Methods
### `init(_:content:)`
Initialize `Carousel`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- elements: The elements.
- content: The view for an element.
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `longSwipes(_:)`
### `allowLongSwipes(_:)`
Set whether long swipes are allowed or not.
- Parameter longSwipes: Whether long swipes are allowed.
- Returns: The carousel.
Whether to allow swiping for more than one page at a time.
If the value is `FALSE`, each swipe can only move to the adjacent pages.
### `allowMouseDrag(_:)`
Sets whether the `AdwCarousel` can be dragged with mouse pointer.
If the value is `FALSE`, dragging is only available on touch.
### `allowScrollWheel(_:)`
Whether the widget will respond to scroll wheel events.
If the value is `FALSE`, wheel events will be ignored.
### `interactive(_:)`
Whether the carousel can be navigated.
This can be used to temporarily disable the carousel to only allow
navigating it in a certain state.
### `nPages(_:)`
The number of pages in a `AdwCarousel`.
### `revealDuration(_:)`
Page reveal duration, in milliseconds.
Reveal duration is used when animating adding or removing pages.
### `spacing(_:)`
Spacing between pages in pixels.
### `pageChanged(_:)`
This signal is emitted after a page has been changed.
It can be used to implement "infinite scrolling" by amending the pages
after every scroll. Note that an empty carousel is indicated by
`(int)index == -1`.

View File

@ -0,0 +1,136 @@
**STRUCT**
# `CenterBox`
`GtkCenterBox` arranges three children in a row, keeping the middle child
centered as well as possible.
![An example GtkCenterBox](centerbox.png)
To add children to `GtkCenterBox`, use [method@Gtk.CenterBox.set_start_widget],
[method@Gtk.CenterBox.set_center_widget] and
[method@Gtk.CenterBox.set_end_widget].
The sizing and positioning of children can be influenced with the
align and expand properties of the children.
# GtkCenterBox as GtkBuildable
The `GtkCenterBox` implementation of the `GtkBuildable` interface
supports placing children in the 3 positions by specifying “start”, “center”
or “end” as the “type” attribute of a `<child>` element.
# CSS nodes
`GtkCenterBox` uses a single CSS node with the name “box”,
The first child of the `GtkCenterBox` will be allocated depending on the
text direction, i.e. in left-to-right layouts it will be allocated on the
left and in right-to-left layouts on the right.
In vertical orientation, the nodes of the children are arranged from top to
bottom.
# Accessibility
Until GTK 4.10, `GtkCenterBox` used the `GTK_ACCESSIBLE_ROLE_GROUP` role.
Starting from GTK 4.12, `GtkCenterBox` uses the `GTK_ACCESSIBLE_ROLE_GENERIC` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `centerWidget`
The widget that is placed at the center position.
### `endWidget`
The widget that is placed at the end position.
In vertical orientation, the end position is at the bottom.
In horizontal orientation, the end position is at the trailing
edge wrt. to the text direction.
### `shrinkCenterLast`
Whether to shrink the center widget after other children.
By default, when there's no space to give all three children their
natural widths, the start and end widgets start shrinking and the
center child keeps natural width until they reach minimum width.
If set to `FALSE`, start and end widgets keep natural width and the
center widget starts shrinking instead.
### `startWidget`
The widget that is placed at the start position.
In vertical orientation, the start position is at the top.
In horizontal orientation, the start position is at the leading
edge wrt. to the text direction.
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `CenterBox`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `centerWidget(_:)`
The widget that is placed at the center position.
### `endWidget(_:)`
The widget that is placed at the end position.
In vertical orientation, the end position is at the bottom.
In horizontal orientation, the end position is at the trailing
edge wrt. to the text direction.
### `shrinkCenterLast(_:)`
Whether to shrink the center widget after other children.
By default, when there's no space to give all three children their
natural widths, the start and end widgets start shrinking and the
center child keeps natural width until they reach minimum width.
If set to `FALSE`, start and end widgets keep natural width and the
center widget starts shrinking instead.
### `startWidget(_:)`
The widget that is placed at the start position.
In vertical orientation, the start position is at the top.
In horizontal orientation, the start position is at the leading
edge wrt. to the text direction.

View File

@ -0,0 +1,187 @@
**STRUCT**
# `CheckButton`
A `GtkCheckButton` places a label next to an indicator.
![Example GtkCheckButtons](check-button.png)
A `GtkCheckButton` is created by calling either [ctor@Gtk.CheckButton.new]
or [ctor@Gtk.CheckButton.new_with_label].
The state of a `GtkCheckButton` can be set specifically using
[method@Gtk.CheckButton.set_active], and retrieved using
[method@Gtk.CheckButton.get_active].
# Inconsistent state
In addition to "on" and "off", check buttons can be an
"in between" state that is neither on nor off. This can be used
e.g. when the user has selected a range of elements (such as some
text or spreadsheet cells) that are affected by a check button,
and the current values in that range are inconsistent.
To set a `GtkCheckButton` to inconsistent state, use
[method@Gtk.CheckButton.set_inconsistent].
# Grouping
Check buttons can be grouped together, to form mutually exclusive
groups - only one of the buttons can be toggled at a time, and toggling
another one will switch the currently toggled one off.
Grouped check buttons use a different indicator, and are commonly referred
to as *radio buttons*.
![Example GtkCheckButtons](radio-button.png)
To add a `GtkCheckButton` to a group, use [method@Gtk.CheckButton.set_group].
When the code must keep track of the state of a group of radio buttons, it
is recommended to keep track of such state through a stateful
`GAction` with a target for each button. Using the `toggled` signals to keep
track of the group changes and state is discouraged.
# CSS nodes
```
checkbutton[.text-button]
├── check
╰── [label]
```
A `GtkCheckButton` has a main node with name checkbutton. If the
[property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child]
properties are set, it contains a child widget. The indicator node
is named check when no group is set, and radio if the checkbutton
is grouped together with other checkbuttons.
# Accessibility
`GtkCheckButton` uses the %GTK_ACCESSIBLE_ROLE_CHECKBOX role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `active`
If the check button is active.
Setting `active` to %TRUE will add the `:checked:` state to both
the check button and the indicator CSS node.
### `child`
The child widget.
### `inconsistent`
If the check button is in an “in between” state.
The inconsistent state only affects visual appearance,
not the semantics of the button.
### `label`
Text of the label inside the check button, if it contains a label widget.
### `useUnderline`
If set, an underline in the text indicates that the following
character is to be used as mnemonic.
### `activate`
Emitted to when the check button is activated.
The `::activate` signal on `GtkCheckButton` is an action signal and
emitting it causes the button to animate press then release.
Applications should never connect to this signal, but use the
[signal@Gtk.CheckButton::toggled] signal.
The default bindings for this signal are all forms of the
<kbd></kbd> and <kbd>Enter</kbd> keys.
### `toggled`
Emitted when the buttons's [property@Gtk.CheckButton:active]
property changes.
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `CheckButton`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `active(_:)`
If the check button is active.
Setting `active` to %TRUE will add the `:checked:` state to both
the check button and the indicator CSS node.
### `child(_:)`
The child widget.
### `inconsistent(_:)`
If the check button is in an “in between” state.
The inconsistent state only affects visual appearance,
not the semantics of the button.
### `label(_:)`
Text of the label inside the check button, if it contains a label widget.
### `useUnderline(_:)`
If set, an underline in the text indicates that the following
character is to be used as mnemonic.
### `activate(_:)`
Emitted to when the check button is activated.
The `::activate` signal on `GtkCheckButton` is an action signal and
emitting it causes the button to animate press then release.
Applications should never connect to this signal, but use the
[signal@Gtk.CheckButton::toggled] signal.
The default bindings for this signal are all forms of the
<kbd></kbd> and <kbd>Enter</kbd> keys.
### `toggled(_:)`
Emitted when the buttons's [property@Gtk.CheckButton:active]
property changes.

View File

@ -2,27 +2,111 @@
# `Clamp`
A horizontal AdwClamp equivalent.
A widget constraining its child to a given size.
<picture><source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"><img src="clamp-wide.png" alt="clamp-wide"></picture><picture><source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"><img src="clamp-narrow.png" alt="clamp-narrow"></picture>
The `AdwClamp` widget constrains the size of the widget it contains to a
given maximum size. It will constrain the width if it is horizontal, or the
height if it is vertical. The expansion of the child from its minimum to its
maximum size is eased out for a smooth transition.
If the child requires more than the requested maximum size, it will be
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.
## CSS nodes
`AdwClamp` has a single CSS node with name `clamp`.
## Properties
### `content`
### `updateFunctions`
The content.
Additional update functions for type extensions.
### `maxSize`
### `appearFunctions`
The maximum size.
Additional appear functions for type extensions.
### `child`
The child widget of the `AdwClamp`.
### `maximumSize`
The maximum size allocated to the child.
It is the width if the clamp is horizontal, or the height if it is vertical.
### `tighteningThreshold`
The size above which the child is clamped.
Starting from this size, the clamp will tighten its grip on the child,
slowly allocating less and less of the available size up to the maximum
allocated size. Below that threshold and below the maximum size, the child
will be allocated all the available size.
If the threshold is greater than the maximum size to allocate to the child,
the child will be allocated all the size up to the maximum.
If the threshold is lower than the minimum size to allocate to the child,
that size will be used as the tightening threshold.
Effectively, tightening the grip on the child before it reaches its maximum
size makes transitions to and from the maximum size smoother when resizing.
### `app`
The application.
### `window`
The window.
## Methods
### `update(_:modifiers:)`
### `init()`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `Clamp`.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `child(_:)`
The child widget of the `AdwClamp`.
### `maximumSize(_:)`
The maximum size allocated to the child.
It is the width if the clamp is horizontal, or the height if it is vertical.
### `tighteningThreshold(_:)`
The size above which the child is clamped.
Starting from this size, the clamp will tighten its grip on the child,
slowly allocating less and less of the available size up to the maximum
allocated size. Below that threshold and below the maximum size, the child
will be allocated all the available size.
If the threshold is greater than the maximum size to allocate to the child,
the child will be allocated all the size up to the maximum.
If the threshold is lower than the minimum size to allocate to the child,
that size will be used as the tightening threshold.
Effectively, tightening the grip on the child before it reaches its maximum
size makes transitions to and from the maximum size smoother when resizing.

View File

@ -2,86 +2,278 @@
# `ComboRow`
A row for selecting an element out of a list of elements.
A [class@Gtk.ListBoxRow] used to choose from a list of items.
<picture><source srcset="combo-row-dark.png" media="(prefers-color-scheme: dark)"><img src="combo-row.png" alt="combo-row"></picture>
The `AdwComboRow` widget allows the user to choose from a list of valid
choices. The row displays the selected choice. When activated, the row
displays a popover which allows the user to make a new choice.
Example of an `AdwComboRow` UI definition:
```xml
<object class="AdwComboRow"><property name="title" translatable="yes">Combo Row</property><property name="model"><object class="GtkStringList"><items><item translatable="yes">Foo</item><item translatable="yes">Bar</item><item translatable="yes">Baz</item></items></object></property></object>
```
The [property@ComboRow:selected] and [property@ComboRow:selected-item]
properties can be used to keep track of the selected item and react to their
changes.
`AdwComboRow` mirrors [class@Gtk.DropDown], see that widget for details.
`AdwComboRow` is [property@Gtk.ListBoxRow:activatable] if a model is set.
## CSS nodes
`AdwComboRow` has a main CSS node with name `row` and the `.combo` style
class.
Its popover has the node named `popover` with the `.menu` style class, it
contains a [class@Gtk.ScrolledWindow], which in turn contains a
[class@Gtk.ListView], both are accessible via their regular nodes.
## Accessibility
`AdwComboRow` uses the `GTK_ACCESSIBLE_ROLE_COMBO_BOX` role.
## Properties
### `title`
### `updateFunctions`
The title.
Additional update functions for type extensions.
### `selection`
### `appearFunctions`
The selected element.
Additional appear functions for type extensions.
### `content`
### `enableSearch`
The content.
Whether to show a search entry in the popup.
If set to `TRUE`, a search entry will be shown in the popup that
allows to search for items in the list.
Search requires [property@ComboRow:expression] to be set.
### `selected`
The position of the selected item.
If no item is selected, the property has the value
[const@Gtk.INVALID_LIST_POSITION]
### `useSubtitle`
Whether to use the current value as the subtitle.
If you use a custom list item factory, you will need to give the row a
name conversion expression with [property@ComboRow:expression].
If set to `TRUE`, you should not access [property@ActionRow:subtitle].
The subtitle is interpreted as Pango markup if
[property@PreferencesRow:use-markup] is set to `TRUE`.
### `activatableWidget`
The widget to activate when the row is activated.
The row can be activated either by clicking on it, calling
[method@ActionRow.activate], or via mnemonics in the title.
See the [property@PreferencesRow:use-underline] property to enable
mnemonics.
The target widget will be activated by emitting the
[signal@Gtk.Widget::mnemonic-activate] signal on it.
### `iconName`
The icon name for this row.
### `subtitle`
The subtitle.
The subtitle for this row.
### `prefix`
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
The prefix.
### `subtitleLines`
The number of lines at the end of which the subtitle label will be
ellipsized.
If the value is 0, the number of lines won't be limited.
### `subtitleSelectable`
Whether the user can copy the subtitle from the label.
See also [property@Gtk.Label:selectable].
### `titleLines`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `activated`
This signal is emitted after the row has been activated.
### `suffix`
The suffix.
The body for the widget "suffix".
### `prefixID`
### `prefix`
The identifier for the prefix content.
The body for the widget "prefix".
### `suffixID`
### `app`
The identifier for the suffix content.
The application.
### `elementsID`
### `window`
The identifier for the elements.
The window.
## Methods
### `init(_:selection:values:)`
### `init()`
Initialize a combo row.
- Parameters:
- title: The row's title.
- selection: The selected value.
- values: The available values.
### `update(_:modifiers:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `ComboRow`.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(row:)`
### `update(_:modifiers:updateProperties:)`
Update the combo row.
- Parameter row: The combo row.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `enableSearch(_:)`
Whether to show a search entry in the popup.
If set to `TRUE`, a search entry will be shown in the popup that
allows to search for items in the list.
Search requires [property@ComboRow:expression] to be set.
### `selected(_:)`
The position of the selected item.
If no item is selected, the property has the value
[const@Gtk.INVALID_LIST_POSITION]
### `useSubtitle(_:)`
Whether to use the current value as the subtitle.
If you use a custom list item factory, you will need to give the row a
name conversion expression with [property@ComboRow:expression].
If set to `TRUE`, you should not access [property@ActionRow:subtitle].
The subtitle is interpreted as Pango markup if
[property@PreferencesRow:use-markup] is set to `TRUE`.
### `activatableWidget(_:)`
The widget to activate when the row is activated.
The row can be activated either by clicking on it, calling
[method@ActionRow.activate], or via mnemonics in the title.
See the [property@PreferencesRow:use-underline] property to enable
mnemonics.
The target widget will be activated by emitting the
[signal@Gtk.Widget::mnemonic-activate] signal on it.
### `iconName(_:)`
The icon name for this row.
### `subtitle(_:)`
Set the combo row's subtitle.
- Parameter subtitle: The subtitle.
- Returns: The combo row.
The subtitle for this row.
### `prefix(_:)`
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
Set the combo row's prefix view.
- Parameter prefix: The prefix.
- Returns: The combo row.
### `subtitleLines(_:)`
### `suffix(_:)`
The number of lines at the end of which the subtitle label will be
ellipsized.
Set the combo row's suffix view.
- Parameter suffix: The suffix.
- Returns: The combo row.
If the value is 0, the number of lines won't be limited.
### `subtitleSelectable(_:)`
Whether the user can copy the subtitle from the label.
See also [property@Gtk.Label:selectable].
### `titleLines(_:)`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title(_:)`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable(_:)`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup(_:)`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.
### `activated(_:)`
This signal is emitted after the row has been activated.

View File

@ -20,12 +20,13 @@ Get the content's container.
- Parameter modifiers: Modify views before being updated.
- Returns: The content's container.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the content.
- Parameters:
- storage: The content's storage.
- modifiers: Modify views before being updated.
- updateProperties: Whether to update properties.
### `modifyView(_:)`

View File

@ -2,86 +2,204 @@
# `EntryRow`
A form content row accepting text input.
A [class@Gtk.ListBoxRow] with an embedded text entry.
<picture><source srcset="entry-row-dark.png" media="(prefers-color-scheme: dark)"><img src="entry-row.png" alt="entry-row"></picture>
`AdwEntryRow` has a title that doubles as placeholder text. It shows an icon
indicating that it's editable and can receive additional widgets before or
after the editable part.
If [property@EntryRow:show-apply-button] is set to `TRUE`, `AdwEntryRow` can
show an apply button when editing its contents. This can be useful if
changing its contents can result in an expensive operation, such as network
activity.
`AdwEntryRow` provides only minimal API and should be used with the
[iface@Gtk.Editable] API.
See also [class@PasswordEntryRow].
## AdwEntryRow as GtkBuildable
The `AdwEntryRow` implementation of the [iface@Gtk.Buildable] interface
supports adding a child at its end by specifying “suffix” or omitting the
“type” attribute of a <child> element.
It also supports adding a child as a prefix widget by specifying “prefix” as
the “type” attribute of a <child> element.
## CSS nodes
`AdwEntryRow` has a single CSS node with name `row` and the `.entry` style
class.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `activatesDefault`
Whether activating the embedded entry can activate the default widget.
### `enableEmojiCompletion`
Whether to suggest emoji replacements on the entry row.
Emoji replacement is done with :-delimited names, like `:heart:`.
### `showApplyButton`
Whether to show the apply button.
When set to `TRUE`, typing text in the entry will reveal an apply button.
Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
emit the [signal@EntryRow::apply] signal.
This is useful if changing the entry contents can trigger an expensive
operation, e.g. network activity, to avoid triggering it after typing every
character.
### `title`
The title.
The title of the preference represented by this row.
### `text`
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
The text.
### `titleSelectable`
### `prefix`
Whether the user can copy the title from the label.
The prefix.
See also [property@Gtk.Label:selectable].
### `useMarkup`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `apply`
Emitted when the apply button is pressed.
See [property@EntryRow:show-apply-button].
### `entryActivated`
Emitted when the embedded entry is activated.
### `suffix`
The suffix.
The body for the widget "suffix".
### `onSubmit`
### `prefix`
The handler that gets executed when the user submits the content.
The body for the widget "prefix".
### `password`
### `app`
Whether the password entry row should be used.
The application.
### `prefixID`
### `window`
The identifier for the prefix content.
### `suffixID`
The identifier for the suffix content.
The window.
## Methods
### `init(_:text:)`
### `init()`
Initialize an entry row.
- Parameters:
- title: The row's title.
- text: The text.
### `update(_:modifiers:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `EntryRow`.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(row:)`
### `update(_:modifiers:updateProperties:)`
Update the entry row.
- Parameter row: The entry row.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `onSubmit(_:)`
### `activatesDefault(_:)`
Set the entry row's subtitle.
- Parameter subtitle: The subtitle.
- Returns: The entry row.
Whether activating the embedded entry can activate the default widget.
### `prefix(_:)`
### `enableEmojiCompletion(_:)`
Set the entry row's prefix view.
- Parameter prefix: The prefix.
- Returns: The entry row.
Whether to suggest emoji replacements on the entry row.
Emoji replacement is done with :-delimited names, like `:heart:`.
### `showApplyButton(_:)`
Whether to show the apply button.
When set to `TRUE`, typing text in the entry will reveal an apply button.
Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
emit the [signal@EntryRow::apply] signal.
This is useful if changing the entry contents can trigger an expensive
operation, e.g. network activity, to avoid triggering it after typing every
character.
### `title(_:)`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable(_:)`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup(_:)`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.
### `apply(_:)`
Emitted when the apply button is pressed.
See [property@EntryRow:show-apply-button].
### `entryActivated(_:)`
Emitted when the embedded entry is activated.
### `suffix(_:)`
Set the entry row's suffix view.
- Parameter suffix: The suffix.
- Returns: The entry row.
Set the body for "suffix".
- Parameter body: The body.
- Returns: The widget.
### `secure()`
### `prefix(_:)`
Let the user securely enter private text.
- Returns: The entry row.
Set the body for "prefix".
- Parameter body: The body.
- Returns: The widget.

View File

@ -0,0 +1,217 @@
**STRUCT**
# `ExpanderRow`
A [class@Gtk.ListBoxRow] used to reveal widgets.
<picture><source srcset="expander-row-dark.png" media="(prefers-color-scheme: dark)"><img src="expander-row.png" alt="expander-row"></picture>
The `AdwExpanderRow` widget allows the user to reveal or hide widgets below
it. It also allows the user to enable the expansion of the row, allowing to
disable all that the row contains.
## AdwExpanderRow as GtkBuildable
The `AdwExpanderRow` implementation of the [iface@Gtk.Buildable] interface
supports adding a child as an suffix widget by specifying “suffix” as the
“type” attribute of a <child> element.
It also supports adding it as a prefix widget by specifying “prefix” as the
“type” attribute of a <child> element.
## CSS nodes
`AdwExpanderRow` has a main CSS node with name `row` and the `.expander`
style class. It has the `.empty` style class when it contains no children.
It contains the subnodes `row.header` for its main embedded row,
`list.nested` for the list it can expand, and `image.expander-row-arrow` for
its arrow.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `enableExpansion`
Whether expansion is enabled.
### `expanded`
Whether the row is expanded.
### `iconName`
The icon name for this row.
### `showEnableSwitch`
Whether the switch enabling the expansion is visible.
### `subtitle`
The subtitle for this row.
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `subtitleLines`
The number of lines at the end of which the subtitle label will be
ellipsized.
If the value is 0, the number of lines won't be limited.
### `titleLines`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `rows`
The body for the widget "rows".
### `suffix`
The body for the widget "suffix".
### `prefix`
The body for the widget "prefix".
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `ExpanderRow`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `enableExpansion(_:)`
Whether expansion is enabled.
### `expanded(_:)`
Whether the row is expanded.
### `iconName(_:)`
The icon name for this row.
### `showEnableSwitch(_:)`
Whether the switch enabling the expansion is visible.
### `subtitle(_:)`
The subtitle for this row.
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `subtitleLines(_:)`
The number of lines at the end of which the subtitle label will be
ellipsized.
If the value is 0, the number of lines won't be limited.
### `titleLines(_:)`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title(_:)`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable(_:)`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup(_:)`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.
### `rows(_:)`
Set the body for "rows".
- Parameter body: The body.
- Returns: The widget.
### `suffix(_:)`
Set the body for "suffix".
- Parameter body: The body.
- Returns: The widget.
### `prefix(_:)`
Set the body for "prefix".
- Parameter body: The body.
- Returns: The widget.

View File

@ -37,10 +37,6 @@ The initial file name for the file exporter.
The accepted extensions for the file importer.
### `folders`
Whether folders are accepted in the file importer.
### `result`
The closure to run when the import or export is successful.
@ -50,7 +46,7 @@ The closure to run when the import or export is successful.
The closure to run when the import or export is not successful.
## Methods
### `init(importer:initialFolder:extensions:folders:onOpen:onClose:)`
### `init(importer:initialFolder:extensions:onOpen:onClose:)`
Create an importer file dialog window.
- Parameters:
@ -77,7 +73,7 @@ Get the storage for the window.
- Parameter app: The application.
- Returns: The storage.
### `update(_:app:)`
### `update(_:app:force:)`
Update a window.
- Parameters:

View File

@ -9,21 +9,12 @@ A list with no dynamic content styled as a boxed list.
The content.
### `view`
The view's body.
## Methods
### `init(content:)`
Initialize a `Form`.
- Parameter content: The view content, usually different kind of rows.
### `update(_:modifiers:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
- Returns: The view storage.

View File

@ -9,21 +9,12 @@ A horizontal GtkBox equivalent.
The content.
### `view`
The view's body.
## Methods
### `init(content:)`
Initialize a `HStack`.
- Parameter content: The view content.
### `update(_:modifiers:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
- Returns: The view storage.

View File

@ -2,78 +2,255 @@
# `HeaderBar`
A header bar widget.
A title bar widget.
<picture><source srcset="header-bar-dark.png" media="(prefers-color-scheme: dark)"><img src="header-bar.png" alt="header-bar"></picture>
`AdwHeaderBar` is similar to [class@Gtk.HeaderBar], but provides additional
features compared to it. Refer to `GtkHeaderBar` for details. It is typically
used as a top bar within [class@ToolbarView].
## Navigation View Integration
When placed inside an [class@NavigationPage], `AdwHeaderBar` will display the
page title instead of window title.
When used together with [class@NavigationView] or [class@NavigationSplitView],
it will also display a back button that can be used to go back to the previous
page. The button also has a context menu, allowing to pop multiple pages at
once, potentially across multiple navigation views. In rare scenarios, set
[property@HeaderBar:show-back-button] to `FALSE` to disable the back button
if it's unwanted (e.g. in an extra header bar on the same page).
## Split View Integration
When placed inside `AdwNavigationSplitView` or `AdwOverlaySplitView`,
`AdwHeaderBar` will automatically hide the title buttons other than at the
edges of the window.
## Centering Policy
[property@HeaderBar:centering-policy] allows to enforce strict centering of
the title widget. This can be useful for entries inside [class@Clamp].
## Title Buttons
Unlike `GtkHeaderBar`, `AdwHeaderBar` allows to toggle title button
visibility for each side individually, using the
[property@HeaderBar:show-start-title-buttons] and
[property@HeaderBar:show-end-title-buttons] properties.
## CSS nodes
```
headerbar
╰── windowhandle
╰── box
├── widget
│ ╰── box.start
│ ├── windowcontrols.start
│ ├── widget
│ │ ╰── [button.back]
│ ╰── [other children]
├── widget
│ ╰── [Title Widget]
╰── widget
╰── box.end
├── [other children]
╰── windowcontrols.end
```
`AdwHeaderBar`'s CSS node is called `headerbar`. It contains a `windowhandle`
subnode, which contains a `box` subnode, which contains three `widget`
subnodes at the start, center and end of the header bar. The start and end
subnotes contain a `box` subnode with the `.start` and `.end` style classes
respectively, and the center node contains a node that represents the title.
Each of the boxes contains a `windowcontrols` subnode, see
[class@Gtk.WindowControls] for details, as well as other children.
When [property@HeaderBar:show-back-button] is `TRUE`, the start box also
contains a node with the name `widget` that contains a node with the name
`button` and `.back` style class.
## Accessibility
`AdwHeaderBar` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `decorationLayout`
The decoration layout for buttons.
If this property is not set, the
[property@Gtk.Settings:gtk-decoration-layout] setting is used.
The format of the string is button names, separated by commas. A colon
separates the buttons that should appear at the start from those at the
end. Recognized button names are minimize, maximize, close and icon (the
window icon).
For example, “icon:minimize,maximize,close” specifies an icon at the start,
and minimize, maximize and close buttons at the end.
### `showBackButton`
Whether the header bar can show the back button.
The back button will never be shown unless the header bar is placed inside an
[class@NavigationView]. Usually, there is no reason to set this to `FALSE`.
### `showEndTitleButtons`
Whether to show title buttons at the end of the header bar.
See [property@HeaderBar:show-start-title-buttons] for the other side.
Which buttons are actually shown and where is determined by the
[property@HeaderBar:decoration-layout] property, and by the state of the
window (e.g. a close button will not be shown if the window can't be
closed).
### `showStartTitleButtons`
Whether to show title buttons at the start of the header bar.
See [property@HeaderBar:show-end-title-buttons] for the other side.
Which buttons are actually shown and where is determined by the
[property@HeaderBar:decoration-layout] property, and by the state of the
window (e.g. a close button will not be shown if the window can't be
closed).
### `showTitle`
Whether the title widget should be shown.
### `titleWidget`
The title widget to display.
When set to `NULL`, the header bar will display the title of the window it
is contained in.
To use a different title, use [class@WindowTitle]:
```xml
<object class="AdwHeaderBar"><property name="title-widget"><object class="AdwWindowTitle"><property name="title" translatable="yes">Title</property></object></property></object>
```
### `start`
The start content of the header bar.
The body for the widget "start".
### `end`
The end content of the header bar.
The body for the widget "end".
### `titleButtons`
### `app`
Whether the title buttons are visible.
The application.
### `headerBarTitle`
### `window`
The view acting as the title of the header bar.
### `startID`
The start content's id.
### `endID`
The end content's id.
### `titleID`
The title's id.
The window.
## Methods
### `init(titleButtons:start:end:)`
### `init()`
Initialize a header bar.
- Parameters:
- titleButtons: Whether the title buttons (e.g. close button) are visible.
- start: The start content.
- end: The end content.
### `empty()`
Initialize an empty header bar.
- Returns: The header bar.
### `start(start:)`
Initialize a header bar with only views at the start.
- Parameter start: The views.
- Returns: The header bar.
### `end(end:)`
Initialize a header bar with only views at the end.
- Parameter start: The views.
- Returns: The header bar.
### `update(_:modifiers:)`
Update a header bar's view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `HeaderBar`.
### `container(modifiers:)`
Get the container for a header bar.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `headerBarTitle(view:)`
### `update(_:modifiers:updateProperties:)`
Set the title widget for the header bar.
- Parameter view: The widget in the header bar.
- Returns: The header bar.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `decorationLayout(_:)`
The decoration layout for buttons.
If this property is not set, the
[property@Gtk.Settings:gtk-decoration-layout] setting is used.
The format of the string is button names, separated by commas. A colon
separates the buttons that should appear at the start from those at the
end. Recognized button names are minimize, maximize, close and icon (the
window icon).
For example, “icon:minimize,maximize,close” specifies an icon at the start,
and minimize, maximize and close buttons at the end.
### `showBackButton(_:)`
Whether the header bar can show the back button.
The back button will never be shown unless the header bar is placed inside an
[class@NavigationView]. Usually, there is no reason to set this to `FALSE`.
### `showEndTitleButtons(_:)`
Whether to show title buttons at the end of the header bar.
See [property@HeaderBar:show-start-title-buttons] for the other side.
Which buttons are actually shown and where is determined by the
[property@HeaderBar:decoration-layout] property, and by the state of the
window (e.g. a close button will not be shown if the window can't be
closed).
### `showStartTitleButtons(_:)`
Whether to show title buttons at the start of the header bar.
See [property@HeaderBar:show-end-title-buttons] for the other side.
Which buttons are actually shown and where is determined by the
[property@HeaderBar:decoration-layout] property, and by the state of the
window (e.g. a close button will not be shown if the window can't be
closed).
### `showTitle(_:)`
Whether the title widget should be shown.
### `titleWidget(_:)`
The title widget to display.
When set to `NULL`, the header bar will display the title of the window it
is contained in.
To use a different title, use [class@WindowTitle]:
```xml
<object class="AdwHeaderBar"><property name="title-widget"><object class="AdwWindowTitle"><property name="title" translatable="yes">Title</property></object></property></object>
```
### `start(_:)`
Set the body for "start".
- Parameter body: The body.
- Returns: The widget.
### `end(_:)`
Set the body for "end".
- Parameter body: The body.
- Returns: The widget.

View File

@ -20,9 +20,10 @@ Get the content's container.
- Parameter modifiers: Modify views before being updated.
- Returns: The content's container.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the content.
- Parameters:
- storage: The content's storage.
- modifiers: Modify views before being updated.
- updateProperties: Whether to update properties.

View File

@ -0,0 +1,416 @@
**STRUCT**
# `Label`
The `GtkLabel` widget displays a small amount of text.
As the name implies, most labels are used to label another widget
such as a [class@Button].
![An example GtkLabel](label.png)
# CSS nodes
```
label
├── [selection]
├── [link]
╰── [link]
```
`GtkLabel` has a single CSS node with the name label. A wide variety
of style classes may be applied to labels, such as .title, .subtitle,
.dim-label, etc. In the `GtkShortcutsWindow`, labels are used with the
.keycap style class.
If the label has a selection, it gets a subnode with name selection.
If the label has links, there is one subnode per link. These subnodes
carry the link or visited state depending on whether they have been
visited. In this case, label node also gets a .link style class.
# GtkLabel as GtkBuildable
The GtkLabel implementation of the GtkBuildable interface supports a
custom `<attributes>` element, which supports any number of `<attribute>`
elements. The <attribute> element has attributes named “name“, “value“,
“start“ and “end“ and allows you to specify [struct@Pango.Attribute]
values for this label.
An example of a UI definition fragment specifying Pango attributes:
```xml
<object class="GtkLabel"><attributes><attribute name="weight" value="PANGO_WEIGHT_BOLD"/><attribute name="background" value="red" start="5" end="10"/></attributes></object>
```
The start and end attributes specify the range of characters to which the
Pango attribute applies. If start and end are not specified, the attribute is
applied to the whole text. Note that specifying ranges does not make much
sense with translatable attributes. Use markup embedded in the translatable
content instead.
# Accessibility
`GtkLabel` uses the %GTK_ACCESSIBLE_ROLE_LABEL role.
# Mnemonics
Labels may contain “mnemonics”. Mnemonics are underlined characters in the
label, used for keyboard navigation. Mnemonics are created by providing a
string with an underscore before the mnemonic character, such as `"_File"`,
to the functions [ctor@Gtk.Label.new_with_mnemonic] or
[method@Gtk.Label.set_text_with_mnemonic].
Mnemonics automatically activate any activatable widget the label is
inside, such as a [class@Gtk.Button]; if the label is not inside the
mnemonics target widget, you have to tell the label about the target
using [class@Gtk.Label.set_mnemonic_widget]. Heres a simple example where
the label is inside a button:
```c
// Pressing Alt+H will activate this button
GtkWidget *button = gtk_button_new ();
GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello");
gtk_button_set_child (GTK_BUTTON (button), label);
```
Theres a convenience function to create buttons with a mnemonic label
already inside:
```c
// Pressing Alt+H will activate this button
GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello");
```
To create a mnemonic for a widget alongside the label, such as a
[class@Gtk.Entry], you have to point the label at the entry with
[method@Gtk.Label.set_mnemonic_widget]:
```c
// Pressing Alt+H will focus the entry
GtkWidget *entry = gtk_entry_new ();
GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello");
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
```
# Markup (styled text)
To make it easy to format text in a label (changing colors,
fonts, etc.), label text can be provided in a simple
markup format:
Heres how to create a label with a small font:
```c
GtkWidget *label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "<small>Small text</small>");
```
(See the Pango manual for complete documentation] of available
tags, [func@Pango.parse_markup])
The markup passed to [method@Gtk.Label.set_markup] must be valid; for example,
literal `<`, `>` and `&` characters must be escaped as `&lt;`, `&gt;`, and `&amp;`.
If you pass text obtained from the user, file, or a network to
[method@Gtk.Label.set_markup], youll want to escape it with
[func@GLib.markup_escape_text] or [func@GLib.markup_printf_escaped].
Markup strings are just a convenient way to set the [struct@Pango.AttrList]
on a label; [method@Gtk.Label.set_attributes] may be a simpler way to set
attributes in some cases. Be careful though; [struct@Pango.AttrList] tends
to cause internationalization problems, unless youre applying attributes
to the entire string (i.e. unless you set the range of each attribute
to [0, %G_MAXINT)). The reason is that specifying the start_index and
end_index for a [struct@Pango.Attribute] requires knowledge of the exact
string being displayed, so translations will cause problems.
# Selectable labels
Labels can be made selectable with [method@Gtk.Label.set_selectable].
Selectable labels allow the user to copy the label contents to
the clipboard. Only labels that contain useful-to-copy information
— such as error messages — should be made selectable.
# Text layout
A label can contain any number of paragraphs, but will have
performance problems if it contains more than a small number.
Paragraphs are separated by newlines or other paragraph separators
understood by Pango.
Labels can automatically wrap text if you call [method@Gtk.Label.set_wrap].
[method@Gtk.Label.set_justify] sets how the lines in a label align
with one another. If you want to set how the label as a whole aligns
in its available space, see the [property@Gtk.Widget:halign] and
[property@Gtk.Widget:valign] properties.
The [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
properties can be used to control the size allocation of ellipsized or
wrapped labels. For ellipsizing labels, if either is specified (and less
than the actual text size), it is used as the minimum width, and the actual
text size is used as the natural width of the label. For wrapping labels,
width-chars is used as the minimum width, if specified, and max-width-chars
is used as the natural width. Even if max-width-chars specified, wrapping
labels will be rewrapped to use all of the available width.
# Links
GTK supports markup for clickable hyperlinks in addition to regular Pango
markup. The markup for links is borrowed from HTML, using the `<a>` with
“href“, “title“ and “class“ attributes. GTK renders links similar to the
way they appear in web browsers, with colored, underlined text. The “title“
attribute is displayed as a tooltip on the link. The “class“ attribute is
used as style class on the CSS node for the link.
An example looks like this:
```c
const char *text =
"Go to the "
"<a href=\"https://www.gtk.org\" title=\"&lt;i&gt;Our&lt;/i&gt; website\">"
"GTK website</a> for more...";
GtkWidget *label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), text);
```
It is possible to implement custom handling for links and their tooltips
with the [signal@Gtk.Label::activate-link] signal and the
[method@Gtk.Label.get_current_uri] function.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `label`
The contents of the label.
If the string contains Pango markup (see [func@Pango.parse_markup]),
you will have to set the [property@Gtk.Label:use-markup] property to
%TRUE in order for the label to display the markup attributes. See also
[method@Gtk.Label.set_markup] for a convenience function that sets both
this property and the [property@Gtk.Label:use-markup] property at the
same time.
If the string contains underlines acting as mnemonics, you will have to
set the [property@Gtk.Label:use-underline] property to %TRUE in order
for the label to display them.
### `lines`
The number of lines to which an ellipsized, wrapping label
should be limited.
This property has no effect if the label is not wrapping or ellipsized.
Set this property to -1 if you don't want to limit the number of lines.
### `maxWidthChars`
The desired maximum width of the label, in characters.
If this property is set to -1, the width will be calculated automatically.
See the section on [text layout](class.Label.html#text-layout) for details of how
[property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
determine the width of ellipsized and wrapped labels.
### `mnemonicKeyval`
The mnemonic accelerator key for the label.
### `mnemonicWidget`
The widget to be activated when the labels mnemonic key is pressed.
### `selectable`
Whether the label text can be selected with the mouse.
### `singleLineMode`
Whether the label is in single line mode.
In single line mode, the height of the label does not depend on the
actual text, it is always set to ascent + descent of the font. This
can be an advantage in situations where resizing the label because
of text changes would be distracting, e.g. in a statusbar.
### `useMarkup`
%TRUE if the text of the label includes Pango markup.
See [func@Pango.parse_markup].
### `useUnderline`
%TRUE if the text of the label indicates a mnemonic with an _
before the mnemonic character.
### `widthChars`
The desired width of the label, in characters.
If this property is set to -1, the width will be calculated automatically.
See the section on [text layout](class.Label.html#text-layout) for details of how
[property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
determine the width of ellipsized and wrapped labels.
### `wrap`
%TRUE if the label text will wrap if it gets too wide.
### `xalign`
The horizontal alignment of the label text inside its size allocation.
Compare this to [property@Gtk.Widget:halign], which determines how the
labels size allocation is positioned in the space available for the label.
### `yalign`
The vertical alignment of the label text inside its size allocation.
Compare this to [property@Gtk.Widget:valign], which determines how the
labels size allocation is positioned in the space available for the label.
### `copyClipboard`
Gets emitted to copy the selection to the clipboard.
The ::copy-clipboard signal is a [keybinding signal](class.SignalAction.html).
The default binding for this signal is <kbd>Ctrl</kbd>+<kbd>c</kbd>.
### `app`
The application.
### `window`
The window.
## Methods
### `init(label:)`
Initialize `Label`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `label(_:)`
The contents of the label.
If the string contains Pango markup (see [func@Pango.parse_markup]),
you will have to set the [property@Gtk.Label:use-markup] property to
%TRUE in order for the label to display the markup attributes. See also
[method@Gtk.Label.set_markup] for a convenience function that sets both
this property and the [property@Gtk.Label:use-markup] property at the
same time.
If the string contains underlines acting as mnemonics, you will have to
set the [property@Gtk.Label:use-underline] property to %TRUE in order
for the label to display them.
### `lines(_:)`
The number of lines to which an ellipsized, wrapping label
should be limited.
This property has no effect if the label is not wrapping or ellipsized.
Set this property to -1 if you don't want to limit the number of lines.
### `maxWidthChars(_:)`
The desired maximum width of the label, in characters.
If this property is set to -1, the width will be calculated automatically.
See the section on [text layout](class.Label.html#text-layout) for details of how
[property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
determine the width of ellipsized and wrapped labels.
### `mnemonicKeyval(_:)`
The mnemonic accelerator key for the label.
### `mnemonicWidget(_:)`
The widget to be activated when the labels mnemonic key is pressed.
### `selectable(_:)`
Whether the label text can be selected with the mouse.
### `singleLineMode(_:)`
Whether the label is in single line mode.
In single line mode, the height of the label does not depend on the
actual text, it is always set to ascent + descent of the font. This
can be an advantage in situations where resizing the label because
of text changes would be distracting, e.g. in a statusbar.
### `useMarkup(_:)`
%TRUE if the text of the label includes Pango markup.
See [func@Pango.parse_markup].
### `useUnderline(_:)`
%TRUE if the text of the label indicates a mnemonic with an _
before the mnemonic character.
### `widthChars(_:)`
The desired width of the label, in characters.
If this property is set to -1, the width will be calculated automatically.
See the section on [text layout](class.Label.html#text-layout) for details of how
[property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
determine the width of ellipsized and wrapped labels.
### `wrap(_:)`
%TRUE if the label text will wrap if it gets too wide.
### `xalign(_:)`
The horizontal alignment of the label text inside its size allocation.
Compare this to [property@Gtk.Widget:halign], which determines how the
labels size allocation is positioned in the space available for the label.
### `yalign(_:)`
The vertical alignment of the label text inside its size allocation.
Compare this to [property@Gtk.Widget:valign], which determines how the
labels size allocation is positioned in the space available for the label.
### `copyClipboard(_:)`
Gets emitted to copy the selection to the clipboard.
The ::copy-clipboard signal is a [keybinding signal](class.SignalAction.html).
The default binding for this signal is <kbd>Ctrl</kbd>+<kbd>c</kbd>.

View File

@ -0,0 +1,197 @@
**STRUCT**
# `LevelBar`
`GtkLevelBar` is a widget that can be used as a level indicator.
Typical use cases are displaying the strength of a password, or
showing the charge level of a battery.
![An example GtkLevelBar](levelbar.png)
Use [method@Gtk.LevelBar.set_value] to set the current value, and
[method@Gtk.LevelBar.add_offset_value] to set the value offsets at which
the bar will be considered in a different state. GTK will add a few
offsets by default on the level bar: %GTK_LEVEL_BAR_OFFSET_LOW,
%GTK_LEVEL_BAR_OFFSET_HIGH and %GTK_LEVEL_BAR_OFFSET_FULL, with
values 0.25, 0.75 and 1.0 respectively.
Note that it is your responsibility to update preexisting offsets
when changing the minimum or maximum value. GTK will simply clamp
them to the new range.
## Adding a custom offset on the bar
```c
static GtkWidget *
create_level_bar (void)
{
GtkWidget *widget;
GtkLevelBar *bar;
widget = gtk_level_bar_new ();
bar = GTK_LEVEL_BAR (widget);
// This changes the value of the default low offset
gtk_level_bar_add_offset_value (bar,
GTK_LEVEL_BAR_OFFSET_LOW,
0.10);
// This adds a new offset to the bar; the application will
// be able to change its color CSS like this:
//
// levelbar block.my-offset {
// background-color: magenta;
// border-style: solid;
// border-color: black;
// border-width: 1px;
// }
gtk_level_bar_add_offset_value (bar, "my-offset", 0.60);
return widget;
}
```
The default interval of values is between zero and one, but its possible
to modify the interval using [method@Gtk.LevelBar.set_min_value] and
[method@Gtk.LevelBar.set_max_value]. The value will be always drawn in
proportion to the admissible interval, i.e. a value of 15 with a specified
interval between 10 and 20 is equivalent to a value of 0.5 with an interval
between 0 and 1. When %GTK_LEVEL_BAR_MODE_DISCRETE is used, the bar level
is rendered as a finite number of separated blocks instead of a single one.
The number of blocks that will be rendered is equal to the number of units
specified by the admissible interval.
For instance, to build a bar rendered with five blocks, its sufficient to
set the minimum value to 0 and the maximum value to 5 after changing the
indicator mode to discrete.
# GtkLevelBar as GtkBuildable
The `GtkLevelBar` implementation of the `GtkBuildable` interface supports a
custom `<offsets>` element, which can contain any number of `<offset>` elements,
each of which must have "name" and "value" attributes.
# CSS nodes
```
levelbar[.discrete]
╰── trough
├── block.filled.level-name
├── block.empty
```
`GtkLevelBar` has a main CSS node with name levelbar and one of the style
classes .discrete or .continuous and a subnode with name trough. Below the
trough node are a number of nodes with name block and style class .filled
or .empty. In continuous mode, there is exactly one node of each, in discrete
mode, the number of filled and unfilled nodes corresponds to blocks that are
drawn. The block.filled nodes also get a style class .level-name corresponding
to the level for the current value.
In horizontal orientation, the nodes are always arranged from left to right,
regardless of text direction.
# Accessibility
`GtkLevelBar` uses the %GTK_ACCESSIBLE_ROLE_METER role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `inverted`
Whether the `GtkLeveBar` is inverted.
Level bars normally grow from top to bottom or left to right.
Inverted level bars grow in the opposite direction.
### `maxValue`
Determines the maximum value of the interval that can be displayed by the bar.
### `minValue`
Determines the minimum value of the interval that can be displayed by the bar.
### `value`
Determines the currently filled value of the level bar.
### `offsetChanged`
Emitted when an offset specified on the bar changes value.
This typically is the result of a [method@Gtk.LevelBar.add_offset_value]
call.
The signal supports detailed connections; you can connect to the
detailed signal "changed::x" in order to only receive callbacks when
the value of offset "x" changes.
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `LevelBar`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `inverted(_:)`
Whether the `GtkLeveBar` is inverted.
Level bars normally grow from top to bottom or left to right.
Inverted level bars grow in the opposite direction.
### `maxValue(_:)`
Determines the maximum value of the interval that can be displayed by the bar.
### `minValue(_:)`
Determines the minimum value of the interval that can be displayed by the bar.
### `value(_:)`
Determines the currently filled value of the level bar.
### `offsetChanged(_:)`
Emitted when an offset specified on the bar changes value.
This typically is the result of a [method@Gtk.LevelBar.add_offset_value]
call.
The signal supports detailed connections; you can connect to the
detailed signal "changed::x" in order to only receive callbacks when
the value of offset "x" changes.

View File

@ -0,0 +1,176 @@
**STRUCT**
# `LinkButton`
A `GtkLinkButton` is a button with a hyperlink.
![An example GtkLinkButton](link-button.png)
It is useful to show quick links to resources.
A link button is created by calling either [ctor@Gtk.LinkButton.new] or
[ctor@Gtk.LinkButton.new_with_label]. If using the former, the URI you
pass to the constructor is used as a label for the widget.
The URI bound to a `GtkLinkButton` can be set specifically using
[method@Gtk.LinkButton.set_uri].
By default, `GtkLinkButton` calls [method@Gtk.FileLauncher.launch] when the button
is clicked. This behaviour can be overridden by connecting to the
[signal@Gtk.LinkButton::activate-link] signal and returning %TRUE from
the signal handler.
# CSS nodes
`GtkLinkButton` has a single CSS node with name button. To differentiate
it from a plain `GtkButton`, it gets the .link style class.
# Accessibility
`GtkLinkButton` uses the %GTK_ACCESSIBLE_ROLE_LINK role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `uri`
The URI bound to this button.
### `visited`
The 'visited' state of this button.
A visited link is drawn in a different color.
### `canShrink`
Whether the size of the button can be made smaller than the natural
size of its contents.
For text buttons, setting this property will allow ellipsizing the label.
If the contents of a button are an icon or a custom widget, setting this
property has no effect.
### `child`
The child widget.
### `hasFrame`
Whether the button has a frame.
### `iconName`
The name of the icon used to automatically populate the button.
### `label`
Text of the label inside the button, if the button contains a label widget.
### `useUnderline`
If set, an underline in the text indicates that the following character is
to be used as mnemonic.
### `activate`
Emitted to animate press then release.
This is an action signal. Applications should never connect
to this signal, but use the [signal@Gtk.Button::clicked] signal.
The default bindings for this signal are all forms of the
<kbd></kbd> and <kbd>Enter</kbd> keys.
### `clicked`
Emitted when the button has been activated (pressed and released).
### `app`
The application.
### `window`
The window.
## Methods
### `init(uri:)`
Initialize `LinkButton`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `uri(_:)`
The URI bound to this button.
### `visited(_:)`
The 'visited' state of this button.
A visited link is drawn in a different color.
### `canShrink(_:)`
Whether the size of the button can be made smaller than the natural
size of its contents.
For text buttons, setting this property will allow ellipsizing the label.
If the contents of a button are an icon or a custom widget, setting this
property has no effect.
### `child(_:)`
The child widget.
### `hasFrame(_:)`
Whether the button has a frame.
### `iconName(_:)`
The name of the icon used to automatically populate the button.
### `label(_:)`
Text of the label inside the button, if the button contains a label widget.
### `useUnderline(_:)`
If set, an underline in the text indicates that the following character is
to be used as mnemonic.
### `activate(_:)`
Emitted to animate press then release.
This is an action signal. Applications should never connect
to this signal, but use the [signal@Gtk.Button::clicked] signal.
The default bindings for this signal are all forms of the
<kbd></kbd> and <kbd>Enter</kbd> keys.
### `clicked(_:)`
Emitted when the button has been activated (pressed and released).

View File

@ -0,0 +1,223 @@
**STRUCT**
# `ListBox`
`GtkListBox` is a vertical list.
A `GtkListBox` only contains `GtkListBoxRow` children. These rows can
by dynamically sorted and filtered, and headers can be added dynamically
depending on the row content. It also allows keyboard and mouse navigation
and selection like a typical list.
Using `GtkListBox` is often an alternative to `GtkTreeView`, especially
when the list contents has a more complicated layout than what is allowed
by a `GtkCellRenderer`, or when the contents is interactive (i.e. has a
button in it).
Although a `GtkListBox` must have only `GtkListBoxRow` children, you can
add any kind of widget to it via [method@Gtk.ListBox.prepend],
[method@Gtk.ListBox.append] and [method@Gtk.ListBox.insert] and a
`GtkListBoxRow` widget will automatically be inserted between the list
and the widget.
`GtkListBoxRows` can be marked as activatable or selectable. If a row is
activatable, [signal@Gtk.ListBox::row-activated] will be emitted for it when
the user tries to activate it. If it is selectable, the row will be marked
as selected when the user tries to select it.
# GtkListBox as GtkBuildable
The `GtkListBox` implementation of the `GtkBuildable` interface supports
setting a child as the placeholder by specifying “placeholder” as the “type”
attribute of a `<child>` element. See [method@Gtk.ListBox.set_placeholder]
for info.
# CSS nodes
|[<!-- language="plain" -->
list[.separators][.rich-list][.navigation-sidebar][.boxed-list]
╰── row[.activatable]
]|
`GtkListBox` uses a single CSS node named list. It may carry the .separators
style class, when the [property@Gtk.ListBox:show-separators] property is set.
Each `GtkListBoxRow` uses a single CSS node named row. The row nodes get the
.activatable style class added when appropriate.
It may also carry the .boxed-list style class. In this case, the list will be
automatically surrounded by a frame and have separators.
The main list node may also carry style classes to select
the style of [list presentation](section-list-widget.html#list-styles):
.rich-list, .navigation-sidebar or .data-table.
# Accessibility
`GtkListBox` uses the %GTK_ACCESSIBLE_ROLE_LIST role and `GtkListBoxRow` uses
the %GTK_ACCESSIBLE_ROLE_LIST_ITEM role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `acceptUnpairedRelease`
Whether to accept unpaired release events.
### `activateOnSingleClick`
Determines whether children can be activated with a single
click, or require a double-click.
### `showSeparators`
Whether to show separators between rows.
### `activateCursorRow`
activateCursorRow
### `moveCursor`
moveCursor
### `rowActivated`
Emitted when a row has been activated by the user.
### `rowSelected`
Emitted when a new row is selected, or (with a %NULL @row)
when the selection is cleared.
When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not
give you the full picture of selection changes, and you should use
the [signal@Gtk.ListBox::selected-rows-changed] signal instead.
### `selectAll`
Emitted to select all children of the box, if the selection
mode permits it.
This is a [keybinding signal](class.SignalAction.html).
The default binding for this signal is <kbd>Ctrl</kbd>-<kbd>a</kbd>.
### `selectedRowsChanged`
Emitted when the set of selected rows changes.
### `toggleCursorRow`
toggleCursorRow
### `unselectAll`
Emitted to unselect all children of the box, if the selection
mode permits it.
This is a [keybinding signal](class.SignalAction.html).
The default binding for this signal is
<kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>a</kbd>.
### `elements`
The dynamic widget elements.
### `content`
The dynamic widget content.
### `app`
The application.
### `window`
The window.
## Methods
### `init(_:content:)`
Initialize `ListBox`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `acceptUnpairedRelease(_:)`
Whether to accept unpaired release events.
### `activateOnSingleClick(_:)`
Determines whether children can be activated with a single
click, or require a double-click.
### `showSeparators(_:)`
Whether to show separators between rows.
### `activateCursorRow(_:)`
activateCursorRow
### `moveCursor(_:)`
moveCursor
### `rowActivated(_:)`
Emitted when a row has been activated by the user.
### `rowSelected(_:)`
Emitted when a new row is selected, or (with a %NULL @row)
when the selection is cleared.
When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not
give you the full picture of selection changes, and you should use
the [signal@Gtk.ListBox::selected-rows-changed] signal instead.
### `selectAll(_:)`
Emitted to select all children of the box, if the selection
mode permits it.
This is a [keybinding signal](class.SignalAction.html).
The default binding for this signal is <kbd>Ctrl</kbd>-<kbd>a</kbd>.
### `selectedRowsChanged(_:)`
Emitted when the set of selected rows changes.
### `toggleCursorRow(_:)`
toggleCursorRow
### `unselectAll(_:)`
Emitted to unselect all children of the box, if the selection
mode permits it.
This is a [keybinding signal](class.SignalAction.html).
The default binding for this signal is
<kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>a</kbd>.

View File

@ -2,20 +2,129 @@
# `Menu`
A menu button widget.
The `GtkMenuButton` widget is used to display a popup when clicked.
![An example GtkMenuButton](menu-button.png)
This popup can be provided either as a `GtkPopover` or as an abstract
`GMenuModel`.
The `GtkMenuButton` widget can show either an icon (set with the
[property@Gtk.MenuButton:icon-name] property) or a label (set with the
[property@Gtk.MenuButton:label] property). If neither is explicitly set,
a [class@Gtk.Image] is automatically created, using an arrow image oriented
according to [property@Gtk.MenuButton:direction] or the generic
“open-menu-symbolic” icon if the direction is not set.
The positioning of the popup is determined by the
[property@Gtk.MenuButton:direction] property of the menu button.
For menus, the [property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
properties of the menu are also taken into account. For example, when the
direction is %GTK_ARROW_DOWN and the horizontal alignment is %GTK_ALIGN_START,
the menu will be positioned below the button, with the starting edge
(depending on the text direction) of the menu aligned with the starting
edge of the button. If there is not enough space below the button, the
menu is popped up above the button instead. If the alignment would move
part of the menu offscreen, it is “pushed in”.
| | start | center | end |
| - | --- | --- | --- |
| **down** | ![](down-start.png) | ![](down-center.png) | ![](down-end.png) |
| **up** | ![](up-start.png) | ![](up-center.png) | ![](up-end.png) |
| **left** | ![](left-start.png) | ![](left-center.png) | ![](left-end.png) |
| **right** | ![](right-start.png) | ![](right-center.png) | ![](right-end.png) |
# CSS nodes
```
menubutton
╰── button.toggle
╰── <content>╰── [arrow]
```
`GtkMenuButton` has a single CSS node with name `menubutton`
which contains a `button` node with a `.toggle` style class.
If the button contains an icon, it will have the `.image-button` style class,
if it contains text, it will have `.text-button` style class. If an arrow is
visible in addition to an icon, text or a custom child, it will also have
`.arrow-button` style class.
Inside the toggle button content, there is an `arrow` node for
the indicator, which will carry one of the `.none`, `.up`, `.down`,
`.left` or `.right` style classes to indicate the direction that
the menu will appear in. The CSS is expected to provide a suitable
image for each of these cases using the `-gtk-icon-source` property.
Optionally, the `menubutton` node can carry the `.circular` style class
to request a round appearance.
# Accessibility
`GtkMenuButton` uses the %GTK_ACCESSIBLE_ROLE_BUTTON role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `active`
Whether the menu button is active.
### `alwaysShowArrow`
Whether to show a dropdown arrow even when using an icon or a custom child.
### `canShrink`
Whether the size of the button can be made smaller than the natural
size of its contents.
### `child`
The child widget.
### `hasFrame`
Whether the button has a frame.
### `iconName`
The name of the icon used to automatically populate the button.
### `label`
The button's label.
The label for the button.
### `icon`
### `menuModel`
The button's icon.
The `GMenuModel` from which the popup will be created.
### `content`
See [method@Gtk.MenuButton.set_menu_model] for the interaction
with the [property@Gtk.MenuButton:popover] property.
The menu's content.
### `primary`
Whether the menu button acts as a primary menu.
Primary menus can be opened using the <kbd>F10</kbd> key
### `useUnderline`
If set an underscore in the text indicates a mnemonic.
### `activate`
Emitted to when the menu button is activated.
The `::activate` signal on `GtkMenuButton` is an action signal and
emitting it causes the button to pop up its menu.
### `app`
@ -26,34 +135,73 @@ The application.
The window.
## Methods
### `init(_:icon:app:window:content:)`
### `init()`
Initialize a menu button.
- Parameters:
- label: The button's label.
- icon: The button's icon.
- app: The application.
- window: The application window.
- content: The menu's content.
### `init(_:app:window:content:)`
Initialize a menu button.
- Parameters:
- label: The buttons label.
- app: The application.
- window: The application window.
- content: The menu's content.
### `update(_:modifiers:)`
Update a button's view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `Menu`.
### `container(modifiers:)`
Get a button's view storage.
- Parameter modifiers: Modify views before being updated.
- Returns: The button's view storage.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `active(_:)`
Whether the menu button is active.
### `alwaysShowArrow(_:)`
Whether to show a dropdown arrow even when using an icon or a custom child.
### `canShrink(_:)`
Whether the size of the button can be made smaller than the natural
size of its contents.
### `child(_:)`
The child widget.
### `hasFrame(_:)`
Whether the button has a frame.
### `iconName(_:)`
The name of the icon used to automatically populate the button.
### `label(_:)`
The label for the button.
### `menuModel(app:window:_:)`
The `GMenuModel` from which the popup will be created.
See [method@Gtk.MenuButton.set_menu_model] for the interaction
with the [property@Gtk.MenuButton:popover] property.
### `primary(_:)`
Whether the menu button acts as a primary menu.
Primary menus can be opened using the <kbd>F10</kbd> key
### `useUnderline(_:)`
If set an underscore in the text indicates a mnemonic.
### `activate(_:)`
Emitted to when the menu button is activated.
The `::activate` signal on `GtkMenuButton` is an action signal and
emitting it causes the button to pop up its menu.

View File

@ -21,6 +21,10 @@ The keyboard shortcut.
Whether to prefer adding the action to the application window.
### `filteredLabel`
The action label.
## Methods
### `init(_:window:handler:)`

View File

@ -16,9 +16,10 @@ Get the content's container.
- Parameter modifiers: Modify views before being updated.
- Returns: The content's container.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the content.
- Parameters:
- storage: The content's storage.
- modifiers: Modify views before being updated.
- updateProperties: Whether to update properties.

View File

@ -35,9 +35,10 @@ Get the container of the navigation split view widget.
- Parameter modifiers: Modify views before being updated.
- Returns: The view storage.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the view storage of the navigation split view widget.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
- updateProperties: Whether to update properties.

View File

@ -2,31 +2,123 @@
# `Overlay`
A wrapper around a view for adding other views on top.
`GtkOverlay` is a container which contains a single main child, on top
of which it can place “overlay” widgets.
![An example GtkOverlay](overlay.png)
The position of each overlay widget is determined by its
[property@Gtk.Widget:halign] and [property@Gtk.Widget:valign]
properties. E.g. a widget with both alignments set to %GTK_ALIGN_START
will be placed at the top left corner of the `GtkOverlay` container,
whereas an overlay with halign set to %GTK_ALIGN_CENTER and valign set
to %GTK_ALIGN_END will be placed a the bottom edge of the `GtkOverlay`,
horizontally centered. The position can be adjusted by setting the margin
properties of the child to non-zero values.
More complicated placement of overlays is possible by connecting
to the [signal@Gtk.Overlay::get-child-position] signal.
An overlays minimum and natural sizes are those of its main child.
The sizes of overlay children are not considered when measuring these
preferred sizes.
# GtkOverlay as GtkBuildable
The `GtkOverlay` implementation of the `GtkBuildable` interface
supports placing a child as an overlay by specifying “overlay” as
the “type” attribute of a `<child>` element.
# CSS nodes
`GtkOverlay` has a single CSS node with the name “overlay”. Overlay children
whose alignments cause them to be positioned at an edge get the style classes
“.left”, “.right”, “.top”, and/or “.bottom” according to their position.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `child`
The child view.
The main child widget.
### `getChildPosition`
Emitted to determine the position and size of any overlay
child widgets.
A handler for this signal should fill @allocation with
the desired position and size for @widget, relative to
the 'main' child of @overlay.
The default handler for this signal uses the @widget's
halign and valign properties to determine the position
and gives the widget its natural size (except that an
alignment of %GTK_ALIGN_FILL will cause the overlay to
be full-width/height). If the main child is a
`GtkScrolledWindow`, the overlays are placed relative
to its contents.
### `overlay`
The overlay view.
The body for the widget "overlay".
### `overlayID`
### `app`
The identifier for the overlay content.
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `Overlay`.
### `container(modifiers:)`
Get the overlay's view storage.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the overlay's view storage.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `child(_:)`
The main child widget.
### `getChildPosition(_:)`
Emitted to determine the position and size of any overlay
child widgets.
A handler for this signal should fill @allocation with
the desired position and size for @widget, relative to
the 'main' child of @overlay.
The default handler for this signal uses the @widget's
halign and valign properties to determine the position
and gives the widget its natural size (except that an
alignment of %GTK_ALIGN_FILL will cause the overlay to
be full-width/height). If the main child is a
`GtkScrolledWindow`, the overlays are placed relative
to its contents.
### `overlay(_:)`
Set the body for "overlay".
- Parameter body: The body.
- Returns: The widget.

View File

@ -2,62 +2,284 @@
# `OverlaySplitView`
An overlay split view widget.
A widget presenting sidebar and content side by side or as an overlay.
<picture><source srcset="overlay-split-view-dark.png" media="(prefers-color-scheme: dark)"><img src="overlay-split-view.png" alt="overlay-split-view"></picture><picture><source srcset="overlay-split-view-collapsed-dark.png" media="(prefers-color-scheme: dark)"><img src="overlay-split-view-collapsed.png" alt="overlay-split-view-collapsed"></picture>
`AdwOverlaySplitView` has two children: sidebar and content, and displays
them side by side.
When [property@OverlaySplitView:collapsed] is set to `TRUE`, the sidebar is
instead shown as an overlay above the content widget.
The sidebar can be hidden or shown using the
[property@OverlaySplitView:show-sidebar] property.
Sidebar can be displayed before or after the content, this can be controlled
with the [property@OverlaySplitView:sidebar-position] property.
Collapsing the split view automatically hides the sidebar widget, and
uncollapsing it shows the sidebar. If this behavior is not desired, the
[property@OverlaySplitView:pin-sidebar] property can be used to override it.
`AdwOverlaySplitView` supports an edge swipe gesture for showing the sidebar,
and a swipe from the sidebar for hiding it. Gestures are only supported on
touchscreen, but not touchpad. Gestures can be controlled with the
[property@OverlaySplitView:enable-show-gesture] and
[property@OverlaySplitView:enable-hide-gesture] properties.
See also [class@NavigationSplitView].
`AdwOverlaySplitView` is typically used together with an [class@Breakpoint]
setting the `collapsed` property to `TRUE` on small widths, as follows:
```xml
<object class="AdwWindow"><property name="width-request">360</property><property name="height-request">200</property><property name="default-width">800</property><property name="default-height">800</property><child><object class="AdwBreakpoint"><condition>max-width: 400sp</condition><setter object="split_view" property="collapsed">True</setter></object></child><property name="content"><object class="AdwOverlaySplitView" id="split_view"><property name="sidebar"><!-- ... --></property><property name="content"><!-- ... --></property></object></property></object>
```
`AdwOverlaySplitView` is often used for implementing the
[utility pane](https://developer.gnome.org/hig/patterns/containers/utility-panes.html)
pattern.
## Sizing
When not collapsed, `AdwOverlaySplitView` changes the sidebar width
depending on its own width.
If possible, it tries to allocate a fraction of the total width, controlled
with the [property@OverlaySplitView:sidebar-width-fraction] property.
The sidebar also has minimum and maximum sizes, controlled with the
[property@OverlaySplitView:min-sidebar-width] and
[property@OverlaySplitView:max-sidebar-width] properties.
The minimum and maximum sizes are using the length unit specified with the
[property@OverlaySplitView:sidebar-width-unit].
By default, sidebar is using 25% of the total width, with 180sp as the
minimum size and 280sp as the maximum size.
When collapsed, the preferred width fraction is ignored and the sidebar uses
[property@OverlaySplitView:max-sidebar-width] when possible.
## Header Bar Integration
When used inside `AdwOverlaySplitView`, [class@HeaderBar] will automatically
hide the window buttons in the middle.
## `AdwOverlaySplitView` as `GtkBuildable`
The `AdwOverlaySplitView` implementation of the [iface@Gtk.Buildable]
interface supports setting the sidebar widget by specifying “sidebar” as the
“type” attribute of a `<child>` element, Specifying “content” child type or
omitting it results in setting the content widget.
## CSS nodes
`AdwOverlaySplitView` has a single CSS node with the name
`overlay-split-view`.
It contains two nodes with the name `widget`, containing the sidebar and
content children.
When not collapsed, they have the `.sidebar-view` and `.content-view` style
classes respectively.
```
overlay-split-view
├── widget.sidebar-pane
│ ╰── [sidebar child]
╰── widget.content-pane
╰── [content child]
```
When collapsed, the one containing the sidebar child has the `.background`
style class and the other one has no style classes.
```
overlay-split-view
├── widget.background
│ ╰── [sidebar child]
╰── widget
╰── [content child]
```
## Accessibility
`AdwOverlaySplitView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
## Properties
### `sidebar`
### `updateFunctions`
The sidebar's content.
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `collapsed`
Whether the split view is collapsed.
When collapsed, the sidebar widget is presented as an overlay above the
content widget, otherwise they are displayed side by side.
### `content`
The split view's main content.
The content widget.
### `trailing`
### `enableHideGesture`
Whether the sidebar is at the trailing position.
Whether the sidebar can be closed with a swipe gesture.
### `visible`
Only touchscreen swipes are supported.
Whether the sidebar is visible.
### `enableShowGesture`
### `sidebarID`
Whether the sidebar can be opened with an edge swipe gesture.
The sidebar content's id.
Only touchscreen swipes are supported.
### `contentID`
### `maxSidebarWidth`
The main content's id.
The maximum sidebar width.
Maximum width is affected by
[property@OverlaySplitView:sidebar-width-unit].
The sidebar widget can still be allocated with larger width if its own
minimum width exceeds it.
### `minSidebarWidth`
The minimum sidebar width.
Minimum width is affected by
[property@OverlaySplitView:sidebar-width-unit].
The sidebar widget can still be allocated with larger width if its own
minimum width exceeds it.
### `pinSidebar`
Whether the sidebar widget is pinned.
By default, collapsing @self automatically hides the sidebar widget, and
uncollapsing it shows the sidebar. If set to `TRUE`, sidebar visibility
never changes on its own.
### `showSidebar`
Whether the sidebar widget is shown.
### `sidebar`
The sidebar widget.
### `sidebarWidthFraction`
The preferred sidebar width as a fraction of the total width.
The preferred width is additionally limited by
[property@OverlaySplitView:min-sidebar-width] and
[property@OverlaySplitView:max-sidebar-width].
The sidebar widget can be allocated with larger width if its own minimum
width exceeds the preferred width.
### `app`
The application.
### `window`
The window.
## Methods
### `init(visible:sidebar:content:)`
### `init()`
Initialize an overlay split view.
- Parameters:
- visible: Whether the sidebar is visible.
- sidebar: The sidebar content.
- content: The main content.
### `trailingSidebar(_:)`
The position of the sidebar.
- Parameter trailing: Whether the sidebar is at the trailing position.
- Returns: The navigation split view.
Initialize `OverlaySplitView`.
### `container(modifiers:)`
Get the container of the overlay split view widget.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the view storage of the overlay split view widget.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `updatePosition(_:)`
### `collapsed(_:)`
Update the sidebar's position in the split view.
- Parameter splitView: The overlay split view.
Whether the split view is collapsed.
When collapsed, the sidebar widget is presented as an overlay above the
content widget, otherwise they are displayed side by side.
### `content(_:)`
The content widget.
### `enableHideGesture(_:)`
Whether the sidebar can be closed with a swipe gesture.
Only touchscreen swipes are supported.
### `enableShowGesture(_:)`
Whether the sidebar can be opened with an edge swipe gesture.
Only touchscreen swipes are supported.
### `maxSidebarWidth(_:)`
The maximum sidebar width.
Maximum width is affected by
[property@OverlaySplitView:sidebar-width-unit].
The sidebar widget can still be allocated with larger width if its own
minimum width exceeds it.
### `minSidebarWidth(_:)`
The minimum sidebar width.
Minimum width is affected by
[property@OverlaySplitView:sidebar-width-unit].
The sidebar widget can still be allocated with larger width if its own
minimum width exceeds it.
### `pinSidebar(_:)`
Whether the sidebar widget is pinned.
By default, collapsing @self automatically hides the sidebar widget, and
uncollapsing it shows the sidebar. If set to `TRUE`, sidebar visibility
never changes on its own.
### `showSidebar(_:)`
Whether the sidebar widget is shown.
### `sidebar(_:)`
The sidebar widget.
### `sidebarWidthFraction(_:)`
The preferred sidebar width as a fraction of the total width.
The preferred width is additionally limited by
[property@OverlaySplitView:min-sidebar-width] and
[property@OverlaySplitView:max-sidebar-width].
The sidebar widget can be allocated with larger width if its own minimum
width exceeds the preferred width.

View File

@ -0,0 +1,178 @@
**STRUCT**
# `PasswordEntryRow`
A [class@EntryRow] tailored for entering secrets.
<picture><source srcset="password-entry-row-dark.png" media="(prefers-color-scheme: dark)"><img src="password-entry-row.png" alt="password-entry-row"></picture>
It does not show its contents in clear text, does not allow to copy it to the
clipboard, and shows a warning when Caps Lock is engaged. If the underlying
platform allows it, `AdwPasswordEntryRow` will also place the text in a
non-pageable memory area, to avoid it being written out to disk by the
operating system.
It offer a way to reveal the contents in clear text.
## CSS Nodes
`AdwPasswordEntryRow` has a single CSS node with name `row` that carries
`.entry` and `.password` style classes.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `activatesDefault`
Whether activating the embedded entry can activate the default widget.
### `enableEmojiCompletion`
Whether to suggest emoji replacements on the entry row.
Emoji replacement is done with :-delimited names, like `:heart:`.
### `showApplyButton`
Whether to show the apply button.
When set to `TRUE`, typing text in the entry will reveal an apply button.
Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
emit the [signal@EntryRow::apply] signal.
This is useful if changing the entry contents can trigger an expensive
operation, e.g. network activity, to avoid triggering it after typing every
character.
### `title`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `apply`
Emitted when the apply button is pressed.
See [property@EntryRow:show-apply-button].
### `entryActivated`
Emitted when the embedded entry is activated.
### `suffix`
The body for the widget "suffix".
### `prefix`
The body for the widget "prefix".
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `PasswordEntryRow`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `activatesDefault(_:)`
Whether activating the embedded entry can activate the default widget.
### `enableEmojiCompletion(_:)`
Whether to suggest emoji replacements on the entry row.
Emoji replacement is done with :-delimited names, like `:heart:`.
### `showApplyButton(_:)`
Whether to show the apply button.
When set to `TRUE`, typing text in the entry will reveal an apply button.
Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
emit the [signal@EntryRow::apply] signal.
This is useful if changing the entry contents can trigger an expensive
operation, e.g. network activity, to avoid triggering it after typing every
character.
### `title(_:)`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable(_:)`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup(_:)`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.
### `apply(_:)`
Emitted when the apply button is pressed.
See [property@EntryRow:show-apply-button].
### `entryActivated(_:)`
Emitted when the embedded entry is activated.

View File

@ -0,0 +1,112 @@
**STRUCT**
# `PreferencesGroup`
A group of preference rows.
<picture><source srcset="preferences-group-dark.png" media="(prefers-color-scheme: dark)"><img src="preferences-group.png" alt="preferences-group"></picture>
An `AdwPreferencesGroup` represents a group or tightly related preferences,
which in turn are represented by [class@PreferencesRow].
To summarize the role of the preferences it gathers, a group can have both a
title and a description. The title will be used by [class@PreferencesWindow]
to let the user look for a preference.
## AdwPreferencesGroup as GtkBuildable
The `AdwPreferencesGroup` implementation of the [iface@Gtk.Buildable] interface
supports adding [class@PreferencesRow]s to the list by omitting "type". If "type"
is omitted and the widget isn't a [class@PreferencesRow] the child is added to
a box below the list.
When the "type" attribute of a child is `header-suffix`, the child
is set as the suffix on the end of the title and description.
## CSS nodes
`AdwPreferencesGroup` has a single CSS node with name `preferencesgroup`.
## Accessibility
`AdwPreferencesGroup` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `description`
The description for this group of preferences.
### `headerSuffix`
The header suffix widget.
Displayed above the list, next to the title and description.
Suffixes are commonly used to show a button or a spinner for the whole
group.
### `title`
The title for this group of preferences.
### `child`
The body for the widget "child".
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `PreferencesGroup`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `description(_:)`
The description for this group of preferences.
### `headerSuffix(_:)`
The header suffix widget.
Displayed above the list, next to the title and description.
Suffixes are commonly used to show a button or a spinner for the whole
group.
### `title(_:)`
The title for this group of preferences.
### `child(_:)`
Set the body for "child".
- Parameter body: The body.
- Returns: The widget.

View File

@ -0,0 +1,104 @@
**STRUCT**
# `PreferencesPage`
A page from [class@PreferencesWindow].
<picture><source srcset="preferences-page-dark.png" media="(prefers-color-scheme: dark)"><img src="preferences-page.png" alt="preferences-page"></picture>
The `AdwPreferencesPage` widget gathers preferences groups into a single page
of a preferences window.
## CSS nodes
`AdwPreferencesPage` has a single CSS node with name `preferencespage`.
## Accessibility
`AdwPreferencesPage` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `description`
The description to be displayed at the top of the page.
### `iconName`
The icon name for this page.
### `name`
The name of this page.
### `title`
The title for this page.
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `child`
The body for the widget "child".
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `PreferencesPage`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `description(_:)`
The description to be displayed at the top of the page.
### `iconName(_:)`
The icon name for this page.
### `name(_:)`
The name of this page.
### `title(_:)`
The title for this page.
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.
### `child(_:)`
Set the body for "child".
- Parameter body: The body.
- Returns: The widget.

View File

@ -0,0 +1,99 @@
**STRUCT**
# `PreferencesRow`
A [class@Gtk.ListBoxRow] used to present preferences.
The `AdwPreferencesRow` widget has a title that [class@PreferencesWindow]
will use to let the user look for a preference. It doesn't present the title
in any way and lets you present the preference as you please.
[class@ActionRow] and its derivatives are convenient to use as preference
rows as they take care of presenting the preference's title while letting you
compose the inputs of the preference around it.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `title`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `PreferencesRow`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `title(_:)`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable(_:)`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup(_:)`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.

View File

@ -2,29 +2,143 @@
# `ProgressBar`
A progress bar widget.
`GtkProgressBar` is typically used to display the progress of a long
running operation.
It provides a visual clue that processing is underway. `GtkProgressBar`
can be used in two different modes: percentage mode and activity mode.
![An example GtkProgressBar](progressbar.png)
When an application can determine how much work needs to take place
(e.g. read a fixed number of bytes from a file) and can monitor its
progress, it can use the `GtkProgressBar` in percentage mode and the
user sees a growing bar indicating the percentage of the work that
has been completed. In this mode, the application is required to call
[method@Gtk.ProgressBar.set_fraction] periodically to update the progress bar.
When an application has no accurate way of knowing the amount of work
to do, it can use the `GtkProgressBar` in activity mode, which shows
activity by a block moving back and forth within the progress area. In
this mode, the application is required to call [method@Gtk.ProgressBar.pulse]
periodically to update the progress bar.
There is quite a bit of flexibility provided to control the appearance
of the `GtkProgressBar`. Functions are provided to control the orientation
of the bar, optional text can be displayed along with the bar, and the
step size used in activity mode can be set.
# CSS nodes
```
progressbar[.osd]
├── [text]
╰── trough[.empty][.full]
╰── progress[.pulse]
```
`GtkProgressBar` has a main CSS node with name progressbar and subnodes with
names text and trough, of which the latter has a subnode named progress. The
text subnode is only present if text is shown. The progress subnode has the
style class .pulse when in activity mode. It gets the style classes .left,
.right, .top or .bottom added when the progress 'touches' the corresponding
end of the GtkProgressBar. The .osd class on the progressbar node is for use
in overlays like the one Epiphany has for page loading progress.
# Accessibility
`GtkProgressBar` uses the %GTK_ACCESSIBLE_ROLE_PROGRESS_BAR role.
## Properties
### `value`
### `updateFunctions`
The value.
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `fraction`
The fraction of total work that has been completed.
### `inverted`
Invert the direction in which the progress bar grows.
### `pulseStep`
The fraction of total progress to move the bounding block when pulsed.
### `showText`
Sets whether the progress bar will show a text in addition
to the bar itself.
The shown text is either the value of the [property@Gtk.ProgressBar:text]
property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction]
value, as a percentage.
To make a progress bar that is styled and sized suitably for showing text
(even if the actual text is blank), set [property@Gtk.ProgressBar:show-text]
to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL).
### `text`
Text to be displayed in the progress bar.
### `app`
The application.
### `window`
The window.
## Methods
### `init(value:total:)`
### `init()`
Initialize a progress bar widget.
- Parameters:
- value: The value.
- total: The maximum value.
### `update(_:modifiers:)`
Update the view storage of the progress bar widget.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `ProgressBar`.
### `container(modifiers:)`
Get the container of the progress bar widget.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `fraction(_:)`
The fraction of total work that has been completed.
### `inverted(_:)`
Invert the direction in which the progress bar grows.
### `pulseStep(_:)`
The fraction of total progress to move the bounding block when pulsed.
### `showText(_:)`
Sets whether the progress bar will show a text in addition
to the bar itself.
The shown text is either the value of the [property@Gtk.ProgressBar:text]
property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction]
value, as a percentage.
To make a progress bar that is styled and sized suitably for showing text
(even if the actual text is blank), set [property@Gtk.ProgressBar:show-text]
to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL).
### `text(_:)`
Text to be displayed in the progress bar.

View File

@ -0,0 +1,310 @@
**STRUCT**
# `ScrolledWindow`
`GtkScrolledWindow` is a container that makes its child scrollable.
It does so using either internally added scrollbars or externally
associated adjustments, and optionally draws a frame around the child.
Widgets with native scrolling support, i.e. those whose classes implement
the [iface@Gtk.Scrollable] interface, are added directly. For other types
of widget, the class [class@Gtk.Viewport] acts as an adaptor, giving
scrollability to other widgets. [method@Gtk.ScrolledWindow.set_child]
intelligently accounts for whether or not the added child is a `GtkScrollable`.
If it isnt, then it wraps the child in a `GtkViewport`. Therefore, you can
just add any child widget and not worry about the details.
If [method@Gtk.ScrolledWindow.set_child] has added a `GtkViewport` for you,
it will be automatically removed when you unset the child.
Unless [property@Gtk.ScrolledWindow:hscrollbar-policy] and
[property@Gtk.ScrolledWindow:vscrollbar-policy] are %GTK_POLICY_NEVER or
%GTK_POLICY_EXTERNAL, `GtkScrolledWindow` adds internal `GtkScrollbar` widgets
around its child. The scroll position of the child, and if applicable the
scrollbars, is controlled by the [property@Gtk.ScrolledWindow:hadjustment]
and [property@Gtk.ScrolledWindow:vadjustment] that are associated with the
`GtkScrolledWindow`. See the docs on [class@Gtk.Scrollbar] for the details,
but note that the “step_increment” and “page_increment” fields are only
effective if the policy causes scrollbars to be present.
If a `GtkScrolledWindow` doesnt behave quite as you would like, or
doesnt have exactly the right layout, its very possible to set up
your own scrolling with `GtkScrollbar` and for example a `GtkGrid`.
# Touch support
`GtkScrolledWindow` has built-in support for touch devices. When a
touchscreen is used, swiping will move the scrolled window, and will
expose 'kinetic' behavior. This can be turned off with the
[property@Gtk.ScrolledWindow:kinetic-scrolling] property if it is undesired.
`GtkScrolledWindow` also displays visual 'overshoot' indication when
the content is pulled beyond the end, and this situation can be
captured with the [signal@Gtk.ScrolledWindow::edge-overshot] signal.
If no mouse device is present, the scrollbars will overlaid as
narrow, auto-hiding indicators over the content. If traditional
scrollbars are desired although no mouse is present, this behaviour
can be turned off with the [property@Gtk.ScrolledWindow:overlay-scrolling]
property.
# CSS nodes
`GtkScrolledWindow` has a main CSS node with name scrolledwindow.
It gets a .frame style class added when [property@Gtk.ScrolledWindow:has-frame]
is %TRUE.
It uses subnodes with names overshoot and undershoot to draw the overflow
and underflow indications. These nodes get the .left, .right, .top or .bottom
style class added depending on where the indication is drawn.
`GtkScrolledWindow` also sets the positional style classes (.left, .right,
.top, .bottom) and style classes related to overlay scrolling
(.overlay-indicator, .dragging, .hovering) on its scrollbars.
If both scrollbars are visible, the area where they meet is drawn
with a subnode named junction.
# Accessibility
Until GTK 4.10, `GtkScrolledWindow` used the `GTK_ACCESSIBLE_ROLE_GROUP` role.
Starting from GTK 4.12, `GtkScrolledWindow` uses the `GTK_ACCESSIBLE_ROLE_GENERIC` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `child`
The child widget.
### `hasFrame`
Whether to draw a frame around the contents.
### `kineticScrolling`
Whether kinetic scrolling is enabled or not.
Kinetic scrolling only applies to devices with source %GDK_SOURCE_TOUCHSCREEN.
### `maxContentHeight`
The maximum content height of @scrolled_window.
### `maxContentWidth`
The maximum content width of @scrolled_window.
### `minContentHeight`
The minimum content height of @scrolled_window.
### `minContentWidth`
The minimum content width of @scrolled_window.
### `overlayScrolling`
Whether overlay scrolling is enabled or not.
If it is, the scrollbars are only added as traditional widgets
when a mouse is present. Otherwise, they are overlaid on top of
the content, as narrow indicators.
Note that overlay scrolling can also be globally disabled, with
the [property@Gtk.Settings:gtk-overlay-scrolling] setting.
### `propagateNaturalHeight`
Whether the natural height of the child should be calculated and propagated
through the scrolled windows requested natural height.
This is useful in cases where an attempt should be made to allocate exactly
enough space for the natural size of the child.
### `propagateNaturalWidth`
Whether the natural width of the child should be calculated and propagated
through the scrolled windows requested natural width.
This is useful in cases where an attempt should be made to allocate exactly
enough space for the natural size of the child.
### `edgeOvershot`
Emitted whenever user initiated scrolling makes the scrolled
window firmly surpass the limits defined by the adjustment
in that orientation.
A similar behavior without edge resistance is provided by the
[signal@Gtk.ScrolledWindow::edge-reached] signal.
Note: The @pos argument is LTR/RTL aware, so callers should be
aware too if intending to provide behavior on horizontal edges.
### `edgeReached`
Emitted whenever user-initiated scrolling makes the scrolled
window exactly reach the lower or upper limits defined by the
adjustment in that orientation.
A similar behavior with edge resistance is provided by the
[signal@Gtk.ScrolledWindow::edge-overshot] signal.
Note: The @pos argument is LTR/RTL aware, so callers should be
aware too if intending to provide behavior on horizontal edges.
### `moveFocusOut`
Emitted when focus is moved away from the scrolled window by a
keybinding.
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.
### `scrollChild`
Emitted when a keybinding that scrolls is pressed.
This is a [keybinding signal](class.SignalAction.html).
The horizontal or vertical adjustment is updated which triggers a
signal that the scrolled windows child may listen to and scroll itself.
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `ScrolledWindow`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `child(_:)`
The child widget.
### `hasFrame(_:)`
Whether to draw a frame around the contents.
### `kineticScrolling(_:)`
Whether kinetic scrolling is enabled or not.
Kinetic scrolling only applies to devices with source %GDK_SOURCE_TOUCHSCREEN.
### `maxContentHeight(_:)`
The maximum content height of @scrolled_window.
### `maxContentWidth(_:)`
The maximum content width of @scrolled_window.
### `minContentHeight(_:)`
The minimum content height of @scrolled_window.
### `minContentWidth(_:)`
The minimum content width of @scrolled_window.
### `overlayScrolling(_:)`
Whether overlay scrolling is enabled or not.
If it is, the scrollbars are only added as traditional widgets
when a mouse is present. Otherwise, they are overlaid on top of
the content, as narrow indicators.
Note that overlay scrolling can also be globally disabled, with
the [property@Gtk.Settings:gtk-overlay-scrolling] setting.
### `propagateNaturalHeight(_:)`
Whether the natural height of the child should be calculated and propagated
through the scrolled windows requested natural height.
This is useful in cases where an attempt should be made to allocate exactly
enough space for the natural size of the child.
### `propagateNaturalWidth(_:)`
Whether the natural width of the child should be calculated and propagated
through the scrolled windows requested natural width.
This is useful in cases where an attempt should be made to allocate exactly
enough space for the natural size of the child.
### `edgeOvershot(_:)`
Emitted whenever user initiated scrolling makes the scrolled
window firmly surpass the limits defined by the adjustment
in that orientation.
A similar behavior without edge resistance is provided by the
[signal@Gtk.ScrolledWindow::edge-reached] signal.
Note: The @pos argument is LTR/RTL aware, so callers should be
aware too if intending to provide behavior on horizontal edges.
### `edgeReached(_:)`
Emitted whenever user-initiated scrolling makes the scrolled
window exactly reach the lower or upper limits defined by the
adjustment in that orientation.
A similar behavior with edge resistance is provided by the
[signal@Gtk.ScrolledWindow::edge-overshot] signal.
Note: The @pos argument is LTR/RTL aware, so callers should be
aware too if intending to provide behavior on horizontal edges.
### `moveFocusOut(_:)`
Emitted when focus is moved away from the scrolled window by a
keybinding.
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.
### `scrollChild(_:)`
Emitted when a keybinding that scrolls is pressed.
This is a [keybinding signal](class.SignalAction.html).
The horizontal or vertical adjustment is updated which triggers a
signal that the scrolled windows child may listen to and scroll itself.

View File

@ -2,101 +2,299 @@
# `SpinRow`
A spin row lets the user select an integer in a certain range.
An [class@ActionRow] with an embedded spin button.
<picture><source srcset="spin-row-dark.png" media="(prefers-color-scheme: dark)"><img src="spin-row.png" alt="spin-row"></picture>
Example of an `AdwSpinRow` UI definition:
```xml
<object class="AdwSpinRow"><property name="title" translatable="yes">Spin Row</property><property name="adjustment"><object class="GtkAdjustment"><property name="lower">0</property><property name="upper">100</property><property name="value">50</property><property name="page-increment">10</property><property name="step-increment">1</property></object></property></object>
```
See [class@Gtk.SpinButton] for details.
## CSS nodes
`AdwSpinRow` has the same structure as [class@ActionRow], as well as the
`.spin` style class on the main node.
## Properties
### `title`
### `updateFunctions`
The title.
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `climbRate`
The acceleration rate when you hold down a button or key.
### `digits`
The number of decimal places to display.
### `numeric`
Whether non-numeric characters should be ignored.
### `snapToTicks`
Whether invalid values are snapped to the nearest step increment.
### `value`
The selected value.
The current value.
### `min`
### `wrap`
The minimum value.
Whether the spin row should wrap upon reaching its limits.
### `max`
### `activatableWidget`
The maximum value.
The widget to activate when the row is activated.
### `step`
The row can be activated either by clicking on it, calling
[method@ActionRow.activate], or via mnemonics in the title.
See the [property@PreferencesRow:use-underline] property to enable
mnemonics.
The increase/decrease step.
The target widget will be activated by emitting the
[signal@Gtk.Widget::mnemonic-activate] signal on it.
### `iconName`
The icon name for this row.
### `subtitle`
The subtitle.
The subtitle for this row.
### `prefix`
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
The prefix.
### `subtitleLines`
The number of lines at the end of which the subtitle label will be
ellipsized.
If the value is 0, the number of lines won't be limited.
### `subtitleSelectable`
Whether the user can copy the subtitle from the label.
See also [property@Gtk.Label:selectable].
### `titleLines`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `input`
Emitted to convert the user's input into a double value.
The signal handler is expected to use [method@Gtk.Editable.get_text] to
retrieve the text of the spinbutton and set new_value to the new value.
The default conversion uses [func@GLib.strtod].
See [signal@Gtk.SpinButton::input].
### `output`
Emitted to tweak the formatting of the value for display.
See [signal@Gtk.SpinButton::output].
### `wrapped`
Emitted right after the spinbutton wraps.
See [signal@Gtk.SpinButton::wrapped].
### `activated`
This signal is emitted after the row has been activated.
### `suffix`
The suffix.
The body for the widget "suffix".
### `prefixID`
### `prefix`
The identifier for the prefix content.
The body for the widget "prefix".
### `suffixID`
### `app`
The identifier for the suffix content.
The application.
### `configID`
### `window`
The identifier of the configuration field.
The window.
## Methods
### `init(_:value:min:max:)`
### `init(climbRate:digits:)`
Initialize a spin row.
- Parameters:
- title: The row's title.
- value: The selected value.
- min: The minimum value.
- max: The maximum value.
### `update(_:modifiers:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `SpinRow`.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(row:)`
### `update(_:modifiers:updateProperties:)`
Update the spin row.
- Parameter row: The spin row.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `climbRate(_:)`
The acceleration rate when you hold down a button or key.
### `digits(_:)`
The number of decimal places to display.
### `numeric(_:)`
Whether non-numeric characters should be ignored.
### `snapToTicks(_:)`
Whether invalid values are snapped to the nearest step increment.
### `value(_:)`
The current value.
### `wrap(_:)`
Whether the spin row should wrap upon reaching its limits.
### `activatableWidget(_:)`
The widget to activate when the row is activated.
The row can be activated either by clicking on it, calling
[method@ActionRow.activate], or via mnemonics in the title.
See the [property@PreferencesRow:use-underline] property to enable
mnemonics.
The target widget will be activated by emitting the
[signal@Gtk.Widget::mnemonic-activate] signal on it.
### `iconName(_:)`
The icon name for this row.
### `subtitle(_:)`
Set the spin row's subtitle.
- Parameter subtitle: The subtitle.
- Returns: The spin row.
The subtitle for this row.
### `prefix(_:)`
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
Set the spin row's prefix view.
- Parameter prefix: The prefix.
- Returns: The spin row.
### `subtitleLines(_:)`
### `suffix(_:)`
The number of lines at the end of which the subtitle label will be
ellipsized.
Set the spin row's suffix view.
- Parameter suffix: The suffix.
- Returns: The spin row.
If the value is 0, the number of lines won't be limited.
### `step(_:)`
### `subtitleSelectable(_:)`
Set the difference a single click on the increase/decrease buttons makes.
- Parameter step: The increase/decrease step.
- Returns: The spin row.
Whether the user can copy the subtitle from the label.
See also [property@Gtk.Label:selectable].
### `titleLines(_:)`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title(_:)`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable(_:)`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup(_:)`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.
### `input(_:)`
Emitted to convert the user's input into a double value.
The signal handler is expected to use [method@Gtk.Editable.get_text] to
retrieve the text of the spinbutton and set new_value to the new value.
The default conversion uses [func@GLib.strtod].
See [signal@Gtk.SpinButton::input].
### `output(_:)`
Emitted to tweak the formatting of the value for display.
See [signal@Gtk.SpinButton::output].
### `wrapped(_:)`
Emitted right after the spinbutton wraps.
See [signal@Gtk.SpinButton::wrapped].
### `activated(_:)`
This signal is emitted after the row has been activated.

View File

@ -0,0 +1,63 @@
**STRUCT**
# `Spinner`
A `GtkSpinner` widget displays an icon-size spinning animation.
It is often used as an alternative to a [class@Gtk.ProgressBar]
for displaying indefinite activity, instead of actual progress.
![An example GtkSpinner](spinner.png)
To start the animation, use [method@Gtk.Spinner.start], to stop it
use [method@Gtk.Spinner.stop].
# CSS nodes
`GtkSpinner` has a single CSS node with the name spinner.
When the animation is active, the :checked pseudoclass is
added to this node.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `spinning`
Whether the spinner is spinning
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `Spinner`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `spinning(_:)`
Whether the spinner is spinning

View File

@ -0,0 +1,204 @@
**STRUCT**
# `SplitButton`
A combined button and dropdown widget.
<picture><source srcset="split-button-dark.png" media="(prefers-color-scheme: dark)"><img src="split-button.png" alt="split-button"></picture>
`AdwSplitButton` is typically used to present a set of actions in a menu,
but allow access to one of them with a single click.
The API is very similar to [class@Gtk.Button] and [class@Gtk.MenuButton], see
their documentation for details.
## CSS nodes
```
splitbutton[.image-button][.text-button]
├── button
│ ╰── <content>├── separator
╰── menubutton
╰── button.toggle
╰── arrow
```
`AdwSplitButton`'s CSS node is called `splitbutton`. It contains the css
nodes: `button`, `separator`, `menubutton`. See [class@Gtk.MenuButton]
documentation for the `menubutton` contents.
The main CSS node will contain the `.image-button` or `.text-button` style
classes matching the button contents. The nested button nodes will never
contain them.
## Accessibility
`AdwSplitButton` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `canShrink`
Whether the button can be smaller than the natural size of its contents.
If set to `TRUE`, the label will ellipsize.
See [property@Gtk.Button:can-shrink] and
[property@Gtk.MenuButton:can-shrink].
### `child`
The child widget.
Setting the child widget will set [property@SplitButton:label] and
[property@SplitButton:icon-name] to `NULL`.
### `dropdownTooltip`
The tooltip of the dropdown button.
The tooltip can be marked up with the Pango text markup language.
### `iconName`
The name of the icon used to automatically populate the button.
Setting the icon name will set [property@SplitButton:label] and
[property@SplitButton:child] to `NULL`.
### `label`
The label for the button.
Setting the label will set [property@SplitButton:icon-name] and
[property@SplitButton:child] to `NULL`.
### `menuModel`
The `GMenuModel` from which the popup will be created.
If the menu model is `NULL`, the dropdown is disabled.
A [class@Gtk.Popover] will be created from the menu model with
[ctor@Gtk.PopoverMenu.new_from_model]. Actions will be connected as
documented for this function.
If [property@SplitButton:popover] is already set, it will be dissociated
from the button, and the property is set to `NULL`.
### `useUnderline`
Whether an underline in the text indicates a mnemonic.
See [property@SplitButton:label].
### `activate`
Emitted to animate press then release.
This is an action signal. Applications should never connect to this signal,
but use the [signal@SplitButton::clicked] signal.
### `clicked`
Emitted when the button has been activated (pressed and released).
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `SplitButton`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `canShrink(_:)`
Whether the button can be smaller than the natural size of its contents.
If set to `TRUE`, the label will ellipsize.
See [property@Gtk.Button:can-shrink] and
[property@Gtk.MenuButton:can-shrink].
### `child(_:)`
The child widget.
Setting the child widget will set [property@SplitButton:label] and
[property@SplitButton:icon-name] to `NULL`.
### `dropdownTooltip(_:)`
The tooltip of the dropdown button.
The tooltip can be marked up with the Pango text markup language.
### `iconName(_:)`
The name of the icon used to automatically populate the button.
Setting the icon name will set [property@SplitButton:label] and
[property@SplitButton:child] to `NULL`.
### `label(_:)`
The label for the button.
Setting the label will set [property@SplitButton:icon-name] and
[property@SplitButton:child] to `NULL`.
### `menuModel(app:window:_:)`
The `GMenuModel` from which the popup will be created.
If the menu model is `NULL`, the dropdown is disabled.
A [class@Gtk.Popover] will be created from the menu model with
[ctor@Gtk.PopoverMenu.new_from_model]. Actions will be connected as
documented for this function.
If [property@SplitButton:popover] is already set, it will be dissociated
from the button, and the property is set to `NULL`.
### `useUnderline(_:)`
Whether an underline in the text indicates a mnemonic.
See [property@SplitButton:label].
### `activate(_:)`
Emitted to animate press then release.
This is an action signal. Applications should never connect to this signal,
but use the [signal@SplitButton::clicked] signal.
### `clicked(_:)`
Emitted when the button has been activated (pressed and released).

View File

@ -21,6 +21,10 @@ Get and set the value without updating the views.
The stored value.
### `forceUpdates`
Whether to force update the views when the value changes.
### `writeValue`
The function for updating the value in the settings file.
@ -30,15 +34,27 @@ The function for updating the value in the settings file.
The value with an erased type.
## Methods
### `init(wrappedValue:)`
### `init(wrappedValue:forceUpdates:)`
Initialize a property representing a state in the view.
- Parameters:
- wrappedValue: The wrapped value.
- forceUpdates: Whether to force update all available views when the property gets modified.
### `updateViews()`
### `updateViews(force:)`
Update all of the views.
- Parameter force: Whether to force all views to update.
### `userDataDir()`
The directory used for storing user data.
- Returns: The URL.
### `copy(_:)`
Copy a text to the clipboard.
- Parameter text: The text.
### `dirPath()`

View File

@ -26,12 +26,13 @@ Initialize a `StateWrapper`.
- content: The view content.
- state: The state information.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
- updateProperties: Whether to update properties.
### `container(modifiers:)`

View File

@ -2,44 +2,93 @@
# `StatusPage`
A status page widget.
A page used for empty/error states and similar use-cases.
<picture><source srcset="status-page-dark.png" media="(prefers-color-scheme: dark)"><img src="status-page.png" alt="status-page"></picture>
The `AdwStatusPage` widget can have an icon, a title, a description and a
custom widget which is displayed below them.
## CSS nodes
`AdwStatusPage` has a main CSS node with name `statuspage`.
`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.
## Properties
### `title`
### `updateFunctions`
The title.
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `child`
The child widget.
### `description`
The description.
The description markup to be displayed below the title.
### `icon`
### `iconName`
The icon.
The name of the icon to be used.
### `content`
Changing this will set [property@StatusPage:paintable] to `NULL`.
Additional content.
### `title`
The title to be displayed below the icon.
It is not parsed as Pango markup.
### `app`
The application.
### `window`
The window.
## Methods
### `init(_:icon:description:content:)`
### `init()`
Initialize a status page widget.
- Parameters:
- title: The title.
- icon: The icon.
- description: Additional details.
- content: Additional content.
### `update(_:modifiers:)`
Update the view storage of the text widget.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `StatusPage`.
### `container(modifiers:)`
Get the container of the text widget.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `child(_:)`
The child widget.
### `description(_:)`
The description markup to be displayed below the title.
### `iconName(_:)`
The name of the icon to be used.
Changing this will set [property@StatusPage:paintable] to `NULL`.
### `title(_:)`
The title to be displayed below the icon.
It is not parsed as Pango markup.

View File

@ -2,77 +2,217 @@
# `SwitchRow`
A row representing a boolean state.
A [class@Gtk.ListBoxRow] used to represent two states.
<picture><source srcset="switch-row-dark.png" media="(prefers-color-scheme: dark)"><img src="switch-row.png" alt="switch-row"></picture>
The `AdwSwitchRow` widget contains a [class@Gtk.Switch] that allows the user
to select between two states: "on" or "off". When activated, the row will
invert its active state.
The user can control the switch by activating the row or by dragging on the
switch handle.
See [class@Gtk.Switch] for details.
Example of an `AdwSwitchRow` UI definition:
```xml
<object class="AdwSwitchRow"><property name="title" translatable="yes">Switch Row</property><signal name="notify::active" handler="switch_row_notify_active_cb"/></object>
```
The [property@SwitchRow:active] property should be connected to in order to
monitor changes to the active state.
## Properties
### `title`
### `updateFunctions`
The title.
Additional update functions for type extensions.
### `isOn`
### `appearFunctions`
Whether the switch is activated.
Additional appear functions for type extensions.
### `active`
Whether the switch row is in the "on" or "off" position.
### `activatableWidget`
The widget to activate when the row is activated.
The row can be activated either by clicking on it, calling
[method@ActionRow.activate], or via mnemonics in the title.
See the [property@PreferencesRow:use-underline] property to enable
mnemonics.
The target widget will be activated by emitting the
[signal@Gtk.Widget::mnemonic-activate] signal on it.
### `iconName`
The icon name for this row.
### `subtitle`
The subtitle.
The subtitle for this row.
### `prefix`
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
The prefix.
### `subtitleLines`
The number of lines at the end of which the subtitle label will be
ellipsized.
If the value is 0, the number of lines won't be limited.
### `subtitleSelectable`
Whether the user can copy the subtitle from the label.
See also [property@Gtk.Label:selectable].
### `titleLines`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline`
Whether an embedded underline in the title indicates a mnemonic.
### `activated`
This signal is emitted after the row has been activated.
### `suffix`
The suffix.
The body for the widget "suffix".
### `prefixID`
### `prefix`
The identifier for the prefix content.
The body for the widget "prefix".
### `suffixID`
### `app`
The identifier for the suffix content.
The application.
### `window`
The window.
## Methods
### `init(_:isOn:)`
### `init()`
Initialize a switch row.
- Parameters:
- title: The row's title.
- isOn: Whether the switch is on.
### `update(_:modifiers:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
Initialize `SwitchRow`.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(row:)`
### `update(_:modifiers:updateProperties:)`
Update the switch row.
- Parameter row: The switch row.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `active(_:)`
Whether the switch row is in the "on" or "off" position.
### `activatableWidget(_:)`
The widget to activate when the row is activated.
The row can be activated either by clicking on it, calling
[method@ActionRow.activate], or via mnemonics in the title.
See the [property@PreferencesRow:use-underline] property to enable
mnemonics.
The target widget will be activated by emitting the
[signal@Gtk.Widget::mnemonic-activate] signal on it.
### `iconName(_:)`
The icon name for this row.
### `subtitle(_:)`
Set the switch row's subtitle.
- Parameter subtitle: The subtitle.
- Returns: The switch row.
The subtitle for this row.
### `prefix(_:)`
The subtitle is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
Set the switch row's prefix view.
- Parameter prefix: The prefix.
- Returns: The switch row.
### `subtitleLines(_:)`
### `suffix(_:)`
The number of lines at the end of which the subtitle label will be
ellipsized.
Set the switch row's suffix view.
- Parameter suffix: The suffix.
- Returns: The switch row.
If the value is 0, the number of lines won't be limited.
### `subtitleSelectable(_:)`
Whether the user can copy the subtitle from the label.
See also [property@Gtk.Label:selectable].
### `titleLines(_:)`
The number of lines at the end of which the title label will be ellipsized.
If the value is 0, the number of lines won't be limited.
### `title(_:)`
The title of the preference represented by this row.
The title is interpreted as Pango markup unless
[property@PreferencesRow:use-markup] is set to `FALSE`.
### `titleSelectable(_:)`
Whether the user can copy the title from the label.
See also [property@Gtk.Label:selectable].
### `useMarkup(_:)`
Whether to use Pango markup for the title label.
Subclasses may also use it for other labels, such as subtitle.
See also [func@Pango.parse_markup].
### `useUnderline(_:)`
Whether an embedded underline in the title indicates a mnemonic.
### `activated(_:)`
This signal is emitted after the row has been activated.

View File

@ -2,40 +2,83 @@
# `ToastOverlay`
A wrapper around a view presenting toasts.
A widget showing toasts above its content.
<picture><source srcset="toast-overlay-dark.png" media="(prefers-color-scheme: dark)"><img src="toast-overlay.png" alt="toast-overlay"></picture>
Much like [class@Gtk.Overlay], `AdwToastOverlay` is a container with a single
main child, on top of which it can display a [class@Toast], overlaid.
Toasts can be shown with [method@ToastOverlay.add_toast].
See [class@Toast] for details.
## CSS nodes
```
toastoverlay
├── [child]
├── toast
┊ ├── widget
┊ │ ├── [label.heading]
│ ╰── [custom title]
├── [button]
╰── button.circular.flat
```
`AdwToastOverlay`'s CSS node is called `toastoverlay`. It contains the child,
as well as zero or more `toast` subnodes.
Each of the `toast` nodes contains a `widget` subnode, optionally a `button`
subnode, and another `button` subnode with `.circular` and `.flat` style
classes.
The `widget` subnode contains a `label` subnode with the `.heading` style
class, or a custom widget provided by the application.
## Accessibility
`AdwToastOverlay` uses the `GTK_ACCESSIBLE_ROLE_TAB_GROUP` role.
## Properties
### `signal`
### `updateFunctions`
The signal for showing the toast./// Present a toast when the signal gets activated.
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `child`
The child view.
The child widget.
### `title`
### `app`
The title of the toast.
The application.
### `button`
### `window`
Information about the button if available (label and handler).
The window.
## Methods
### `init()`
Initialize `ToastOverlay`.
### `container(modifiers:)`
Get the overlay's view storage.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the overlay's view storage.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `setVisibility(_:)`
### `child(_:)`
Add a toast if the signal is active.
- Parameter overlay: The toast overlay.
The child widget.

View File

@ -0,0 +1,221 @@
**STRUCT**
# `ToggleButton`
A `GtkToggleButton` is a button which remains “pressed-in” when
clicked.
Clicking again will cause the toggle button to return to its normal state.
A toggle button is created by calling either [ctor@Gtk.ToggleButton.new] or
[ctor@Gtk.ToggleButton.new_with_label]. If using the former, it is advisable
to pack a widget, (such as a `GtkLabel` and/or a `GtkImage`), into the toggle
buttons container. (See [class@Gtk.Button] for more information).
The state of a `GtkToggleButton` can be set specifically using
[method@Gtk.ToggleButton.set_active], and retrieved using
[method@Gtk.ToggleButton.get_active].
To simply switch the state of a toggle button, use
[method@Gtk.ToggleButton.toggled].
## Grouping
Toggle buttons can be grouped together, to form mutually exclusive
groups - only one of the buttons can be toggled at a time, and toggling
another one will switch the currently toggled one off.
To add a `GtkToggleButton` to a group, use [method@Gtk.ToggleButton.set_group].
## CSS nodes
`GtkToggleButton` has a single CSS node with name button. To differentiate
it from a plain `GtkButton`, it gets the `.toggle` style class.
## Accessibility
`GtkToggleButton` uses the %GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON role.
## Creating two `GtkToggleButton` widgets.
```c
static void
output_state (GtkToggleButton *source,
gpointer user_data)
{
g_print ("Toggle button "%s" is active: %s",
gtk_button_get_label (GTK_BUTTON (source)),
gtk_toggle_button_get_active (source) ? "Yes" : "No");
}
static void
make_toggles (void)
{
GtkWidget *window, *toggle1, *toggle2;
GtkWidget *box;
const char *text;
window = gtk_window_new ();
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
text = "Hi, Im toggle button one";
toggle1 = gtk_toggle_button_new_with_label (text);
g_signal_connect (toggle1, "toggled",
G_CALLBACK (output_state),
NULL);
gtk_box_append (GTK_BOX (box), toggle1);
text = "Hi, Im toggle button two";
toggle2 = gtk_toggle_button_new_with_label (text);
g_signal_connect (toggle2, "toggled",
G_CALLBACK (output_state),
NULL);
gtk_box_append (GTK_BOX (box), toggle2);
gtk_window_set_child (GTK_WINDOW (window), box);
gtk_window_present (GTK_WINDOW (window));
}
```
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `active`
If the toggle button should be pressed in.
### `canShrink`
Whether the size of the button can be made smaller than the natural
size of its contents.
For text buttons, setting this property will allow ellipsizing the label.
If the contents of a button are an icon or a custom widget, setting this
property has no effect.
### `child`
The child widget.
### `hasFrame`
Whether the button has a frame.
### `iconName`
The name of the icon used to automatically populate the button.
### `label`
Text of the label inside the button, if the button contains a label widget.
### `useUnderline`
If set, an underline in the text indicates that the following character is
to be used as mnemonic.
### `toggled`
Emitted whenever the `GtkToggleButton`'s state is changed.
### `activate`
Emitted to animate press then release.
This is an action signal. Applications should never connect
to this signal, but use the [signal@Gtk.Button::clicked] signal.
The default bindings for this signal are all forms of the
<kbd></kbd> and <kbd>Enter</kbd> keys.
### `clicked`
Emitted when the button has been activated (pressed and released).
### `app`
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `ToggleButton`.
### `container(modifiers:)`
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:updateProperties:)`
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `active(_:)`
If the toggle button should be pressed in.
### `canShrink(_:)`
Whether the size of the button can be made smaller than the natural
size of its contents.
For text buttons, setting this property will allow ellipsizing the label.
If the contents of a button are an icon or a custom widget, setting this
property has no effect.
### `child(_:)`
The child widget.
### `hasFrame(_:)`
Whether the button has a frame.
### `iconName(_:)`
The name of the icon used to automatically populate the button.
### `label(_:)`
Text of the label inside the button, if the button contains a label widget.
### `useUnderline(_:)`
If set, an underline in the text indicates that the following character is
to be used as mnemonic.
### `toggled(_:)`
Emitted whenever the `GtkToggleButton`'s state is changed.
### `activate(_:)`
Emitted to animate press then release.
This is an action signal. Applications should never connect
to this signal, but use the [signal@Gtk.Button::clicked] signal.
The default bindings for this signal are all forms of the
<kbd></kbd> and <kbd>Enter</kbd> keys.
### `clicked(_:)`
Emitted when the button has been activated (pressed and released).

View File

@ -2,39 +2,257 @@
# `ToolbarView`
A toolbar view widget.
A widget containing a page, as well as top and/or bottom bars.
<picture><source srcset="toolbar-view-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view.png" alt="toolbar-view"></picture>
`AdwToolbarView` has a single content widget and one or multiple top and
bottom bars, shown at the top and bottom sides respectively.
Example of an `AdwToolbarView` UI definition:
```xml
<object class="AdwToolbarView"><child type="top"><object class="AdwHeaderBar"/></child><property name="content"><object class="AdwPreferencesPage"><!-- ... --></object></property></object>
```
The following kinds of top and bottom bars are supported:
- [class@HeaderBar]
- [class@TabBar]
- [class@ViewSwitcherBar]
- [class@Gtk.ActionBar]
- [class@Gtk.HeaderBar]
- [class@Gtk.PopoverMenuBar]
- [class@Gtk.SearchBar]
- Any [class@Gtk.Box] or a similar widget with the
[`.toolbar`](style-classes.html#toolbars) style class
By default, top and bottom bars are flat and scrolling content has a subtle
undershoot shadow, same as when using the
[`.undershoot-top`](style-classes.html#undershot-indicators) and
[`.undershoot-bottom`](style-classes.html#undershot-indicators) style
classes. This works well in most cases, e.g. with [class@StatusPage] or
[class@PreferencesPage], where the background at the top and bottom parts of
the page is uniform. Additionally, windows with sidebars should always use
this style.
[property@ToolbarView:top-bar-style] and
[property@ToolbarView:bottom-bar-style] properties can be used add an opaque
background and a persistent shadow to top and bottom bars, this can be useful
for content such as [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
where some elements are adjacent to the top/bottom bars, or [class@TabView],
where each page can have a different background.
<picture style="min-width: 33%; display: inline-block;"><source srcset="toolbar-view-flat-1-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-flat-1.png" alt="toolbar-view-flat-1"></picture><picture style="min-width: 33%; display: inline-block;"><source srcset="toolbar-view-flat-2-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-flat-2.png" alt="toolbar-view-flat-2"></picture><picture style="min-width: 33%; display: inline-block;"><source srcset="toolbar-view-raised-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-raised.png" alt="toolbar-view-raised"></picture>
`AdwToolbarView` ensures the top and bottom bars have consistent backdrop
styles and vertical spacing. For comparison:
<picture style="min-width: 40%; display: inline-block;"><source srcset="toolbar-view-spacing-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-spacing.png" alt="toolbar-view-spacing"></picture><picture style="min-width: 40%; display: inline-block;"><source srcset="toolbar-view-spacing-box-dark.png" media="(prefers-color-scheme: dark)"><img src="toolbar-view-spacing-box.png" alt="toolbar-view-spacing-box"></picture>
Any top and bottom bars can also be dragged to move the window, equivalent
to putting them into a [class@Gtk.WindowHandle].
Content is typically place between top and bottom bars, but can also extend
behind them. This is controlled with the
[property@ToolbarView:extend-content-to-top-edge] and
[property@ToolbarView:extend-content-to-bottom-edge] properties.
Top and bottom bars can be hidden and revealed with an animation using the
[property@ToolbarView:reveal-top-bars] and
[property@ToolbarView:reveal-bottom-bars] properties.
## `AdwToolbarView` as `GtkBuildable`
The `AdwToolbarView` implementation of the [iface@Gtk.Buildable] interface
supports adding a top bar by specifying “top” as the “type” attribute of a
`<child>` element, or adding a bottom bar by specifying “bottom”.
## Accessibility
`AdwToolbarView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
## Properties
### `updateFunctions`
Additional update functions for type extensions.
### `appearFunctions`
Additional appear functions for type extensions.
### `bottomBarHeight`
The current bottom bar height.
Bottom bar height does change depending on
[property@ToolbarView:reveal-bottom-bars], including during the transition.
See [property@ToolbarView:top-bar-height].
### `content`
The sidebar's content.
The content widget.
### `toolbar`
### `extendContentToBottomEdge`
The toolbars.
Whether the content widget can extend behind bottom bars.
This can be used in combination with
[property@ToolbarView:reveal-bottom-bars] to show and hide toolbars in
fullscreen.
See [property@ToolbarView:extend-content-to-top-edge].
### `extendContentToTopEdge`
Whether the content widget can extend behind top bars.
This can be used in combination with [property@ToolbarView:reveal-top-bars]
to show and hide toolbars in fullscreen.
See [property@ToolbarView:extend-content-to-bottom-edge].
### `revealBottomBars`
Whether bottom bars are visible.
The transition will be animated.
This can be used in combination with
[property@ToolbarView:extend-content-to-bottom-edge] to show and hide
toolbars in fullscreen.
See [property@ToolbarView:reveal-top-bars].
### `revealTopBars`
Whether top bars are revealed.
The transition will be animated.
This can be used in combination with
[property@ToolbarView:extend-content-to-top-edge] to show and hide toolbars
in fullscreen.
See [property@ToolbarView:reveal-bottom-bars].
### `topBarHeight`
The current top bar height.
Top bar height does change depending [property@ToolbarView:reveal-top-bars],
including during the transition.
See [property@ToolbarView:bottom-bar-height].
### `bottom`
Whether the toolbars are bottom toolbars.
The body for the widget "bottom".
### `visible`
### `top`
Whether the toolbar is visible.
The body for the widget "top".
### `toolbarID`
### `app`
The identifier of the toolbar content.
The application.
### `window`
The window.
## Methods
### `init()`
Initialize `ToolbarView`.
### `container(modifiers:)`
Get the container of the toolbar view widget.
- Parameter modifiers: Modify views before being updated.
Get the widget's view storage.
- Parameter modifiers: The view modifiers.
- Returns: The view storage.
### `update(_:modifiers:)`
### `update(_:modifiers:updateProperties:)`
Update the view storage of the toolbar view widget.
Update the widget's view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
- modifiers: The view modifiers.
- updateProperties: Whether to update the view's properties.
### `bottomBarHeight(_:)`
The current bottom bar height.
Bottom bar height does change depending on
[property@ToolbarView:reveal-bottom-bars], including during the transition.
See [property@ToolbarView:top-bar-height].
### `content(_:)`
The content widget.
### `extendContentToBottomEdge(_:)`
Whether the content widget can extend behind bottom bars.
This can be used in combination with
[property@ToolbarView:reveal-bottom-bars] to show and hide toolbars in
fullscreen.
See [property@ToolbarView:extend-content-to-top-edge].
### `extendContentToTopEdge(_:)`
Whether the content widget can extend behind top bars.
This can be used in combination with [property@ToolbarView:reveal-top-bars]
to show and hide toolbars in fullscreen.
See [property@ToolbarView:extend-content-to-bottom-edge].
### `revealBottomBars(_:)`
Whether bottom bars are visible.
The transition will be animated.
This can be used in combination with
[property@ToolbarView:extend-content-to-bottom-edge] to show and hide
toolbars in fullscreen.
See [property@ToolbarView:reveal-top-bars].
### `revealTopBars(_:)`
Whether top bars are revealed.
The transition will be animated.
This can be used in combination with
[property@ToolbarView:extend-content-to-top-edge] to show and hide toolbars
in fullscreen.
See [property@ToolbarView:reveal-bottom-bars].
### `topBarHeight(_:)`
The current top bar height.
Top bar height does change depending [property@ToolbarView:reveal-top-bars],
including during the transition.
See [property@ToolbarView:bottom-bar-height].
### `bottom(_:)`
Set the body for "bottom".
- Parameter body: The body.
- Returns: The widget.
### `top(_:)`
Set the body for "top".
- Parameter body: The body.
- Returns: The widget.

Some files were not shown because too many files have changed in this diff Show More