Functions#
- accent_color_to_rgba(self: AccentColor) RGBA #
- Parameters:
self
- accent_color_to_standalone_rgba(self: AccentColor, dark: bool) RGBA #
- Parameters:
self
dark
- breakpoint_condition_parse(str: str) BreakpointCondition #
- Parameters:
str
- get_enable_animations(widget: Widget) bool #
Checks whether animations are enabled for
widget
.This should be used when implementing an animated widget to know whether to animate it or not.
- Parameters:
widget – a
GtkWidget
- Returns:
whether animations are enabled for
widget
- get_major_version() int #
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
MAJOR_VERSION
constant, which represents the major version of the libadwaita headers you have included when compiling your code.- Returns:
the major version number of the Adwaita library
- get_micro_version() int #
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
MAJOR_VERSION
constant, which represents the micro version of the libadwaita headers you have included when compiling your code.- Returns:
the micro version number of the Adwaita library
- get_minor_version() int #
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
MAJOR_VERSION
constant, which represents the minor version of the libadwaita headers you have included when compiling your code.- Returns:
the minor version number of the Adwaita library
- init() None #
Initializes Libadwaita.
This function can be used instead of
init
as it initializes GTK implicitly.There’s no need to call this function if you’re using
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.
- is_initialized() bool #
Use this function to check if libadwaita has been initialized with
init
.- Returns:
the initialization status
- length_unit_from_px(unit: LengthUnit, value: float, settings: Settings | None = None) float #
- Parameters:
unit
value
settings
- length_unit_to_px(unit: LengthUnit, value: float, settings: Settings | None = None) float #
- Parameters:
unit
value
settings
- lerp(a: float, b: float, t: float) float #
Computes the linear interpolation between
a
andb
fort
.- Parameters:
a – the start
b – the end
t – the interpolation rate
- Returns:
the computed value
- rgba_to_standalone(rgba: RGBA, dark: bool) RGBA #
Adjusts
rgba
to be suitable as a standalone color.It will typically be darker for light background, and lighter for dark background, ensuring contrast.
Added in version 1.6.
- Parameters:
rgba – a background color
dark – Whether to calculate standalone color for light or dark background