Week 2 Summary

Week 2 Summary

Introduction

I am Vaibhav Malik, a Google Summer Of Code contributor and developer at Inkscape. This blog summarizes my progress during the second week of the Google Summer Of Code 2023.

June 05

Mikekov suggested moving the SpinButton widget and the unit menu of the Select toolbar into the "UI" file. It houses four spin button widgets and manages the following properties of the objects under selection:

  • X coordinate

  • Y coordinate

  • Width

  • Height

The problem was that the spin buttons and the unit menu were custom widgets. Therefore, those widgets were not directly available in the Glade interface. I was not even sure if that was at all possible. I asked Mikekov for hints, to which he indicated going through the codebase and learning to use the get_widget_derived method.

June 06

I spent the whole day learning to use get_widget_derived. And attempted to use it inside the select toolbar but couldn't succeed. The get_widget_derived method is a tricky one. During my first attempt, I was stormed with errors.

June 07

Invested another day learning to use get_widget_derived. Today carefully analyzed its implementation in the remaining codebase. I started by going through the object-attributes dialogue code. I was not able to replicate it inside the select toolbar. I got frustrated and asked Mikekov to reconsider moving all those custom widgets to the "UI" file.

June 08

Today I was determined to give get_widget_derived another try. I had to get this working to move ahead with the port. Finally, after 2-3 attempts, I could implement it. The trick was to use the initializer list syntax.

June 09

Today I moved the Gtk::Adjustment widgets for each spin button to the "UI" file. And refactored some code inside the select toolbar constructor. Mikekov also suggested marking toolbar children as movable using Glade. And implement the Gtk::StyleContext approach to determine the movable children inside each toolbar.

June 10

I requested Tav for a code review. He pointed out some minor details and redundant code. After Tav's code review, I added a refactoring commit which included lots of redundant code removal. Today I also added the movable and context_item classes using Glade to the widgets of the select toolbar. It simplified a lot of code and was much more generic than hardcoding them.

June 11

Spent this Sunday working on minor UI issues related to the select toolbar. And planned how to port the remaining toolbars. Today Mikekov suggested using multiple popovers instead of just one. This'll allow grouping related widgets as one group inside a separate popover with a special icon. This is similar to how the Finder app in MacOS manages resizing.

Conclusion

That was pretty much it for this week. This was a challenging week, though I didn't write much code. Stay tuned for further updates. Thanks for reading :)