August - Gtk4 Migration (Tavmjong)
Martedì 19 Settembre 2023 12:39
August got off to a slow start as I was in the US with family the first part of the month. But then things picked up:
StatusBar
I finished the work I began in July on refactoring the StatusBar (the bottom most row in the Inkscape interface). I converted the pop-menus for the Zoom and Rotate widgets to use Gio::Menus, which is necessary for Gtk4.
Events
We've moved to using our own event structure to handle events (mouse clicks, key strokes, etc.) within the Inkscape canvas (the part of the interface that shows the drawing). We were modifying the Gtk events that we received to help with manipulating object in the drawing. Gtk4 doesn't allow modifying events so instead we now create our own events. This required modifying the event handlers in each of our tools. I finished the work started by Matt Jakeman and PBS.
SelectedStyle
The SelectedStyle widget is the one in the lower left side of the Inkscape window that shows the current Fill and Stroke colors, the Opacity, and the Stroke width. I refactored this widget, removing several "EventBoxes" that are not supported by Gtk4 and whose functionality was not actually used (an EventBox allows one to wrap a normally non-interactive widget, like a label, to enable interactivity). In one case, the EventBox was being used. I moved the the middle-click pop-up menu to a different widget that does handle mouse events. It can be moved back if necessary in Gtk4 as with Gtk4 any widget can have interactivity added. (Did you know that middle mouse clicking on the "O:" label in Inkscape 1.3 will cycle through 0%, 50%, and 100% opacity? In the current development version, middle-clicking on the opacity value widget will do the same.) I also greatly simplified the code.
Items Worked On:
- Merge request reviews (keeping up with Daniel is almost a full time job in itself!).
- Cleaned up InksviewWindow code (used by Inkview).
- Removed unneeded dependency on the GDK cursor enumeration that disappears in Gtk4.
- Updated the --debug-info version code to avoid using macros removed from Gtk4 and at the same time improving the information given.
- Corrected badly formatted editor variable syntax in some files.
- Cleaned up the "builder" files that describe some of the GUI structure, in preparation for updating to Gtk4.
- Using our own functions to access widgets in builder files (will make it easier during the Gtk4 transition).
- Fixed initialization of SPColor to avoid error messages when working with mesh gradients.