Package ch.bailu.gtk.adw
Klasse Breakpoint
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.adw.Breakpoint
- Alle implementierten Schnittstellen:
PointerInterface
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:
```xml
<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>
```
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:
```xml
<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>
```
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Breakpoint.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungBreakpoint
(BreakpointCondition condition) Creates a new `AdwBreakpoint` with @condition.Breakpoint
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Adds a setter to @self.void
Adds a setter to @self.void
addSetters
(Object first_object, Str first_property, Object... _ellipsis) Adds multiple setters to @self.void
addSetters
(Object first_object, String first_property, Object... _ellipsis) Adds multiple setters to @self.Implements interfaceBuildable
.static ClassHandler
Gets the condition for @self.static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
onApply
(Breakpoint.OnApply signal) Connect to signal "apply".onUnapply
(Breakpoint.OnUnapply signal) Connect to signal "unapply".void
setCondition
(BreakpointCondition condition) Sets the condition for @self.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_APPLY
- Siehe auch:
-
SIGNAL_ON_UNAPPLY
- Siehe auch:
-
-
Konstruktordetails
-
Breakpoint
-
Breakpoint
Creates a new `AdwBreakpoint` with @condition.- Parameter:
condition
- the condition
-
-
Methodendetails
-
getClassHandler
-
addSetter
Adds a setter to @self.
The setter will automatically set @property on @object to @value when
applying the breakpoint, and set it back to its original value upon
unapplying it.
::: note
Setting properties to their original values does not work for properties
that have irreversible side effects. For example, changing
[property@Gtk.Button:label] while [property@Gtk.Button:icon-name] is set
will reset the icon. However, resetting the label will not set
`icon-name` to its original value.
Use the [signal@Breakpoint::apply] and [signal@Breakpoint::unapply] signals
for those properties instead, as follows:
```c
static void
breakpoint_apply_cb (MyWidget *self)
{
gtk_button_set_icon_name (self->button, "go-previous-symbolic");
}
static void
breakpoint_apply_cb (MyWidget *self)
{
gtk_button_set_label (self->button, _("_Back"));
}
// ...
g_signal_connect_swapped (breakpoint, "apply",
G_CALLBACK (breakpoint_apply_cb), self);
g_signal_connect_swapped (breakpoint, "unapply",
G_CALLBACK (breakpoint_unapply_cb), self);
```- Parameter:
object
- the target objectproperty
- the target propertyvalue
- the value to set
-
addSetter
Adds a setter to @self.
The setter will automatically set @property on @object to @value when
applying the breakpoint, and set it back to its original value upon
unapplying it.
::: note
Setting properties to their original values does not work for properties
that have irreversible side effects. For example, changing
[property@Gtk.Button:label] while [property@Gtk.Button:icon-name] is set
will reset the icon. However, resetting the label will not set
`icon-name` to its original value.
Use the [signal@Breakpoint::apply] and [signal@Breakpoint::unapply] signals
for those properties instead, as follows:
```c
static void
breakpoint_apply_cb (MyWidget *self)
{
gtk_button_set_icon_name (self->button, "go-previous-symbolic");
}
static void
breakpoint_apply_cb (MyWidget *self)
{
gtk_button_set_label (self->button, _("_Back"));
}
// ...
g_signal_connect_swapped (breakpoint, "apply",
G_CALLBACK (breakpoint_apply_cb), self);
g_signal_connect_swapped (breakpoint, "unapply",
G_CALLBACK (breakpoint_unapply_cb), self);
```- Parameter:
object
- the target objectproperty
- the target propertyvalue
- the value to set
-
addSetters
public void addSetters(@Nonnull Object first_object, @Nonnull Str first_property, Object... _ellipsis) Adds multiple setters to @self.
See [method@Breakpoint.add_setter].
Example:
```c
adw_breakpoint_add_setters (breakpoint,
G_OBJECT (box), "orientation", GTK_ORIENTATION_VERTICAL,
G_OBJECT (button), "halign", GTK_ALIGN_FILL,
G_OBJECT (button), "valign", GTK_ALIGN_END,
NULL);
```- Parameter:
first_object
- the first target objectfirst_property
- the first target property_ellipsis
- the value of the first setter, followed by a list of object, property and value triplets, terminated by `NULL`
-
addSetters
Adds multiple setters to @self.
See [method@Breakpoint.add_setter].
Example:
```c
adw_breakpoint_add_setters (breakpoint,
G_OBJECT (box), "orientation", GTK_ORIENTATION_VERTICAL,
G_OBJECT (button), "halign", GTK_ALIGN_FILL,
G_OBJECT (button), "valign", GTK_ALIGN_END,
NULL);
```- Parameter:
first_object
- the first target objectfirst_property
- the first target property_ellipsis
- the value of the first setter, followed by a list of object, property and value triplets, terminated by `NULL`
-
getCondition
Gets the condition for @self.- Gibt zurück:
- the condition
-
setCondition
Sets the condition for @self.- Parameter:
condition
- the new condition
-
onApply
Connect to signal "apply".
SeeBreakpoint.OnApply.onApply()
for signal description.
FieldSIGNAL_ON_APPLY
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onUnapply
Connect to signal "unapply".
SeeBreakpoint.OnUnapply.onUnapply()
for signal description.
FieldSIGNAL_ON_UNAPPLY
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Gibt zurück:
Buildable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-