Breakpoint

class Breakpoint(pointer: <Error class: unknown class><<Error class: unknown class>>)

Describes a breakpoint for class@Window or class@Dialog.

Breakpoints are used to create adaptive UI, allowing to change the layout depending on available size.

Breakpoint is a size threshold, specified by its condition, as well as one or more setters.

Each setter has a target object, a property and a value. When a breakpoint is applied, each setter sets the target property on their target object to the specified value, and reset it back to the original value when it's unapplied.

For more complicated scenarios, signal@Breakpoint::apply and signal@Breakpoint::unapply can be used instead.

Breakpoints can be used within class@Window, class@ApplicationWindow, class@Dialog or class@BreakpointBin.

AdwBreakpoint as GtkBuildable:

AdwBreakpoint supports specifying its condition via the <condition> element. The contents of the element must be a string in a format accepted by func@BreakpointCondition.parse.

It also supports adding setters via the <setter> element. Each <setter> element must have the object attribute specifying the target object, and the property attribute specifying the property name. The contents of the element are used as the setter value.

For G_TYPE_OBJECT and G_TYPE_BOXED derived properties, empty contents are treated as NULL.

Setter values can be translated with the usual translatable, context and comments attributes.

Example of an AdwBreakpoint UI definition:

<object class="AdwBreakpoint">
<condition>max-width: 400px</condition>
<setter object="button" property="visible">True</setter>
<setter object="box" property="orientation">vertical</setter>
<setter object="page" property="title" translatable="yes">Example</setter>
</object>

Skipped during bindings generation

  • parameter objects: Array parameter of type GObject.Object is not supported

Since

1.4

Constructors

Link copied to clipboard
constructor(condition: BreakpointCondition)

Creates a new AdwBreakpoint with @condition.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val adwBreakpointPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

The breakpoint's condition.

Link copied to clipboard
open val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun addSetter(object: <Error class: unknown class>, property: String, value: <Error class: unknown class>? = null)

Adds a setter to @self.

Link copied to clipboard
fun connectApply(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the breakpoint is applied.

Link copied to clipboard
fun connectUnapply(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the breakpoint is unapplied.

Link copied to clipboard

Gets the condition for @self.

Link copied to clipboard
fun setCondition(condition: BreakpointCondition? = null)

Sets the condition for @self.