Release of the Libadwaita 1.5 library for creating GNOME-style interfaces

The GNOME Project has published the release of the Libadwaita 1.5 library, which includes a set of components for styling the user interface that complies with the GNOME HIG (Human Interface Guidelines) recommendations. The library includes ready-made widgets and objects for building applications that comply with the general GNOME style, the interface of which can adapt responsively to screens of any size. The library code is written in C language and distributed under the LGPL 2.1+ license.

The libadwaita library is used in conjunction with GTK4 and includes components of the Adwaita skin used in GNOME, which have been moved out of GTK into a separate library. Moving GNOME visuals into a separate library allows GNOME-needed changes to be developed separately from GTK, allowing GTK developers to focus on the basics, and GNOME developers to more quickly and flexibly push styling changes for themselves without affecting GTK itself.

The library includes standard widgets covering various interface elements, such as lists, panels, editing blocks, buttons, tabs, search forms, dialog boxes, etc. The proposed widgets allow you to create universal interfaces that function seamlessly both on large screens of PCs and laptops, and on small touch screens of smartphones. The application interface dynamically changes depending on the screen size and available input devices. The library also includes a set of Adwaita styles that bring the look and feel to GNOME guidelines without the need for manual customization.

Release of the Libadwaita 1.5 library for creating GNOME-style interfaces

The main change in libadwaita 1.5 was the reworking of adaptive widgets to create dialog boxes that adjust to the size of the visible area. Unlike traditional dialogs, which are housed in separate windows, new dialogs are rendered client-side, rendered inside existing windows, and cannot extend beyond the parent window. This approach simplifies the creation of universal dialogs that can be combined with interfaces for mobile and desktop systems, and also provides additional options for managing dialogs (for example, there is no need to monitor for exiting the window border, you can choose the behavior of close buttons, automatic expansion to full screen is provided in mobile versions of applications, the style of the current window, not the system, is taken into account when dimming the dialog).

Release of the Libadwaita 1.5 library for creating GNOME-style interfacesRelease of the Libadwaita 1.5 library for creating GNOME-style interfaces

In the future, it is planned to implement another version of such dialogs, linked not to windows, but to tabs inside the window, which may be needed in applications such as browsers so that dialogs associated with a tab do not overlap the main window when switching between tabs.

For mobile devices, support has been implemented for placing dialogs in the form of sheets docked at the bottom of the screen (bottom sheets), rather than in the form of sheets aligned to the center. Dialogs attached to the bottom save users from confusion with closing windows - in such dialogs, part of the parent window remains visible and the buttons for closing the parent window and the dialog itself are clearly separated, so it is now difficult to confuse them.

Release of the Libadwaita 1.5 library for creating GNOME-style interfaces

New dialogs are managed using the AdwDialog class, which in most situations is similar to using the GtkWindow class, with the differences being the display and close operations. For example, the β€œ:transient-for” property was replaced with a parameter in the adw_dialog_present() function, a new signal β€œ::close-attempt” was added, and the processing of the β€œ:can-close” parameter was changed. Instead of the AdwPreferencesWindow, AdwAboutWindow and AdwMessageDialog classes, it is proposed to use the AdwPreferencesDialog, AdwAboutDialog and AdwAlertDialog classes with new dialogs.

Dialogs that do not have a parent window will still be treated as separate windows. Dialogs whose parent windows cannot be used to host dialogs will also function as windows, for example, if they do not allow resizing or do not have the AdwWindow and AdwApplicationWindow classes for them.

Changes not related to dialogue rework in Libadwaita 1.5:

  • Added ":text-length" property to the AdwEntryRow class to limit the size of the text in the input field.
  • Added remove_response() method to the AdwMessageDialog class.
  • The ability to programmatically remove breakpoints has been added to the AdwBreakpointBin class, which allows you to change the user interface in any way depending on the window size.
  • Added ":allow-window-handle" flag to the AdwSwipeTracker class to allow swiping on top of the top bar (used in sheets attached to the bottom edge).
  • Increased the brightness of the colors used when shading windows in a dark design style.

Source: opennet.ru

Add a comment