GSoC 2021 Final Report

Porting GNOME Design tools to GTK 4

As described in a previous post, the goal in this GSoC was to port Icon Library and App Icon Preview to the GTK 4 toolkit, with a corresponding port from libhandy to libadwaita.

Work Done

Both applications were successfully ported (icon-library/!16, app-icon-preview/!62). As far as we known, there is only one know regression in App Icon Preview where symbolic icons do not follow the Icon Theme, there is already a MR in place to address this.

Some additional work was done in icon-library/!17, app-icon-preview/!64, and app-icon-preview/!63; the latest MR is in the latest stages of submission and does a small refactor on how icons are loaded and cached, using a proper Icon Theme, this allows to load icons directly from their name rather than passing around images, Pixbufs or textures and enforces the Icon Theme on symbolic icons, fixing the last remaining regression.

Future Work

Now that both apps are ported, and some widgets have been subclassed, it would be easier to implement mockups, and in the case of Icon Library, implement a system to update the icons at runtime. We plan to release new versions of both apps around the release of GNOME 41.

Final Words

Working on GNOME Design tools proved to be a very positive experience which allowed me to work on two very interesting projects that will surely help fellow developers and designers.  I want to thank Bilal Elmoussaoui, who has been guiding and helping me since I joined the GNOME community.

GSoC 2021 and GNOME Design tools

This Google School of Code, I decided to work with Bilal Elmoussaoui as a mentor, the goal being updating some GNOME design tools to GTK 4, specifically Icon Library and App Icon Preview. Both apps are written in Rust and make use of the gtk-rs bindings for gtk.

Icon Library

Icon Library is an app to preview symbolic icons in icon-development-kit. It allows to export and search icons. The process of porting Icon Library !16 was quite straightforward. The clipboard had to be adapted to the new api and the search provider had to be tweaked.

The most interesting bit was the search feature. Because of the better support for subclassing in gtk4-rs, it was natural to use list models for displaying lists, which in turn made using a filter on the model an obvious choice. But applying a filter on the list model resulted that each icon had to be redrawn on each search query, which is quite slow. The solution was to go back to setting the filter directly on the list widget.

App Icon Preview

App Icon Preview is an app for designing icons that target the GNOME environment. One complex part of porting this is app is its dependence on librsvg, which was recently updated for the latest gtk-rs. Another friction point is that widgets have moved away from using Cairo as their render and the Paintable api is not very friendly with the Clipboard or saving widgets as images. Clipboards consume`gdk::Texture` which contain metainfo, and Paintables have no methods to construct such.

After some investigation, we found a way to free the node from the render and paint it into the Cairo context used to drawn the texture.

The port !62 still has some rough edges, but it is looking promising.