Application


Object Hierarchy:

Object hierarchy for Application

Description:

[ CCode ( type_id = "adw_application_get_type ()" ) ]
public class Application : Application, ActionGroup, ActionMap

A base class for Adwaita applications.

`AdwApplication` handles library initialization by calling [func@init] in the default [signal@Gio.Application: AdwApplication:startup] signal handler, in turn chaining up as required by [class@Gtk.Application]. Therefore, any subclass of `AdwApplication` should always chain up its `startup` handler before using any Adwaita or GTK API.

Automatic Resources

`AdwApplication` will automatically load certain resources located in the application's resource base path (see [ method@Gio.Application.set_resource_base_path], if they're present.

### Shortcuts Dialog

If there's a resource located at `shortcuts-dialog.ui` which defines an [class@ShortcutsDialog] with the ID `shortcuts_dialog`, `AdwApplication` will set up an `app.shortcuts` action that creates and presents this dialog, as well as a <kbd>Ctrl</kbd>< kbd>?</kbd> accelerator for it.

### Stylesheet

If there's a resource located at `style.css`, `AdwApplication` will load styles from it. This can be used to add custom styles to the application.

#### Additional styles (deprecated)

`AdwApplication` will also load the following stylesheets conditionally:

  • `style-dark.css` when [property@StyleManager:dark] is `TRUE`.
  • `style-hc.css` when the system high contrast preference is enabled.
  • `style-hc-dark.css` when the system high contrast preference is enabled and [property@StyleManager:dark] is `TRUE`.

:AdwApplication::warning These resources are deprecated since 1.9.

Use `style.css` with the following media queries instead:

  • `prefers-color-scheme: dark` for styles used only for dark appearance.
  • `prefers-contrast: more` for styles used only when the system high contrast preference is enabled.

Namespace: Adw
Package: libadwaita-1

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from interface GLib.ActionMap