Table of contents
Introduction
I am Vaibhav Malik, a Google Summer Of Code contributor and developer at Inkscape. This blog summarizes my progress during the bonding period and the first week of the Google Summer Of Code 2023.
Bonding Period
As soon as the bonding period started, I discussed with Tav the workflow and which module to begin from. He suggested starting with Gtk::Toolbar replacement as this widget has been deprecated in GTK+4. He also told me to keep working on the master branch until the build-breaking changes are not there.
All the Inkscape's toolbars are derived from the Gtk::Toolbar
class and contain widgets derived from Gtk::ToolItem
both of which have been deprecated in GTK+4. Most of the toolbar-related code is present in the src/ui/toolbar/
and src/widget/
directories. The following list summarizes the changes I made during the bonding period:
Started by changing the derivation of
Inkscape::UI::Toolbar
fromGtk::Toolbar
toGtk::Box
.Read the toolbar-related code.
Discussed with fellow developers and the UI/UX team how to best handle the over-flowing widgets in the toolbars after switching to
Gtk::Box
.There were two approaches available(Contraction-expansion and popovers). However, using popovers to store the overflowing content seemed to have the most benefits.
I discussed overflow handling with Tav. We decided to target a specific screen resolution and shrink all the toolbars by default based on the selected screen resolution. Based on the stats, I guess 1920 x 1080 should be the obvious choice(https://gs.statcounter.com/screen-resolution-stats/desktop/worldwide).
This means that on screens having a screen resolution below the target resolution, Inkscape toolbars will contain a popover to hold the overflowing contents. Each popover will contain
Gtk::Grid
. No more than two rows will be used to store the overflowing widgets. Otherwise, all the toolbar children will be available inside the toolbars.
May 24
The coding period officially began. I started by listing down all the toolbars that need to be resized to fit. Of all twenty-four toolbars, only the shape builder, box-3d, spiral, pen, dropper, connector, LPE, zoom, and pages toolbar need not be restructured to fit.
Toolbars like the calligraphy, text, tweak and spray require special attention as these are much wider than the others.
May 25
After examining each toolbar, I created groups of similar widgets to be put inside the popover. Some of these groups are:
SpinButtons and the unit menu.
ToggleButtons and Buttons.
Grouping similar widgets will help maintain the homogeneity of the popover while utilizing the available space most effectively.
May 26
Today I committed the local changes and created a draft merge request so developers and mentors can review the code. In this commit, I added the toolbar-select.ui
file and designed the select toolbar using Glade.
Link to the merge request: https://gitlab.com/inkscape/inkscape/-/merge_requests/5335
May 27
Today, I worked on the src/ui/toolbar/select-toolbar.*
files to make the select toolbar load from its UI file.
Added all the widgets using the builder.
Then I removed the widget declaration code from the constructor.
Then I added the actions to each button using Glade. And attached signals to the remaining widgets.
Next, I assigned the tooltips to each button using Glade.
In the end, I refactored some of the previous code.
Link to the video showing the new design of the Select toolbar: https://drive.google.com/file/d/1lMHCm38nlJZI10JFS3VA4aX2NOsxEivs/view?usp=sharing
May 28
It was Sunday today, so I took some time off. Mikekov asked about the presence of popover on wider screens on GitLab. This reminded me that I forgot to add the code to check whether to use the popover or not use it. Then I wrote the code to remove the popover if the screen resolution was large enough. I set the 1920 x 1080 resolution as the target size for Inkscape. I did so because statistics indicate that this screen resolution dominates the market.
Mikekov also indicated that I'm grouping the wrong set of widgets in the Select toolbar. This happened because I forgot to discuss the grouping with the UI/UX team.
Link to Mikekov's comment: https://gitlab.com/inkscape/inkscape/-/merge_requests/5335#note_1408201382
Conclusion
That was pretty much it for this week. Stay tuned for further updates. Thanks for reading :)