Functions¶
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Adw.breakpoint_condition_parse(str)¶
- Parameters:
str (
str
) – the string specifying the condition- Returns:
the parsed condition
- Return type:
Parses a condition from a string.
Length conditions are specified as
<type>: <value>[<unit>]
, where:<type>
can bemin-width
,max-width
,min-height
ormax-height
<value>
is a fractional number<unit>
can bepx
,pt
orsp
If the unit is omitted,
px
is assumed.See [ctor`BreakpointCondition`.new_length].
Examples:
min-width: 500px
min-height: 400pt
max-width: 100sp
max-height: 500
Ratio conditions are specified as
<type>: <width>[/<height>]
, where:<type>
can bemin-aspect-ratio
ormax-aspect-ratio
<width>
and<height>
are integer numbers
See [ctor`BreakpointCondition`.new_ratio].
The ratio is represented as
<width>
divided by<height>
.If
<height>
is omitted, it’s assumed to be 1.Examples:
min-aspect-ratio: 4/3
max-aspect-ratio: 1
The logical operators
and
,or
can be used to compose a complex condition as follows:<condition> and <condition>
: the condition is true when both ``<condition>``s are true, same as when using [ctor`BreakpointCondition`.new_and]<condition> or <condition>
: the condition is true when either of the ``<condition>``s is true, same as when using [ctor`BreakpointCondition`.new_or]
Examples:
min-width: 400px and max-aspect-ratio: 4/3
max-width: 360sp or max-width: 360px
Conditions can be further nested using parentheses, for example:
min-width: 400px and (max-aspect-ratio: 4/3 or max-height: 400px)
If parentheses are omitted, the first operator takes priority.
New in version 1.4.
- Adw.easing_ease(self, value)¶
- Parameters:
self (
Adw.Easing
) – an easing valuevalue (
float
) – a value to ease
- Returns:
the easing for value
- Return type:
Computes easing with easing for value.
value should generally be in the [0, 1] range.
- Adw.get_enable_animations(widget)¶
- Parameters:
widget (
Gtk.Widget
) – aGtkWidget
- Returns:
whether animations are enabled for widget
- Return type:
Checks whether animations are enabled for widget.
This should be used when implementing an animated widget to know whether to animate it or not.
- Adw.get_major_version()¶
- Returns:
the major version number of the Adwaita library
- Return type:
Returns the major version number of the Adwaita library.
For example, in libadwaita version 1.2.3 this is 1.
This function is in the library, so it represents the libadwaita library your code is running against. Contrast with the [constMAJOR_VERSION] constant, which represents the major version of the libadwaita headers you have included when compiling your code.
- Adw.get_micro_version()¶
- Returns:
the micro version number of the Adwaita library
- Return type:
Returns the micro version number of the Adwaita library.
For example, in libadwaita version 1.2.3 this is 3.
This function is in the library, so it represents the libadwaita library your code is running against. Contrast with the [constMAJOR_VERSION] constant, which represents the micro version of the libadwaita headers you have included when compiling your code.
- Adw.get_minor_version()¶
- Returns:
the minor version number of the Adwaita library
- Return type:
Returns the minor version number of the Adwaita library.
For example, in libadwaita version 1.2.3 this is 2.
This function is in the library, so it represents the libadwaita library your code is running against. Contrast with the [constMAJOR_VERSION] constant, which represents the minor version of the libadwaita headers you have included when compiling your code.
- Adw.init()¶
Initializes Libadwaita.
This function can be used instead of [func`Gtk`.init] as it initializes GTK implicitly.
There’s no need to call this function if you’re using [class`Application`].
If Libadwaita has already been initialized, the function will simply return.
This makes sure translations, types, themes, and icons for the Adwaita library are set up properly.
- Adw.is_initialized()¶
- Returns:
the initialization status
- Return type:
Use this function to check if libadwaita has been initialized with [func`init`].
- Adw.length_unit_from_px(unit, value, settings)¶
- Parameters:
unit (
Adw.LengthUnit
) – a length unitvalue (
float
) – a value in pixelssettings (
Gtk.Settings
orNone
) – settings to use, orNULL
for default settings
- Returns:
the length in unit
- Return type:
Converts value from pixels to unit.
New in version 1.4.
- Adw.length_unit_to_px(unit, value, settings)¶
- Parameters:
unit (
Adw.LengthUnit
) – a length unitvalue (
float
) – a value in unitsettings (
Gtk.Settings
orNone
) – settings to use, orNULL
for default settings
- Returns:
the length in pixels
- Return type:
Converts value from unit to pixels.
New in version 1.4.