GSOC 2022: Second Update

Hello everyone! 😄

Its been a while since my last update, and I have made significant progress :D

In my previous blog post, I mentioned using the GtkListView for the templates submenu. But, after a few discussions with my mentor @antoniof, we decided to use the GtkListBox to create the custom widget for the new documents creation feature, as it would be easier to implement and there is no need to create a factory for it.

The GtkListBox takes in the GtkExpander and GtkBox widgets as its children, making the whole list of templates visible in a single view!
The GtkBox has GtkLabel and GtkImage as its children, displaying the file name and icon respectively. 
This is what it looks like:


But this implementation has its flaws :/
  • The subfolders were not showing the expander widget on the first try.
  • When clicking on a subfolder, instead of expanding, it gave an error message saying it's not a file.
The templates submenu also needs a feature which gives users an option to search for templates. I am using a GtkVerticalBox widget for this, which takes in GtkSearchEntry and the GtkListBox I created earlier as its child widgets. But it's unable to search for templates within subfolders if they are not expanded earlier.

Another issue I faced was implementing this same custom widget in the path bar menu. You see, the new documents creation feature is accessible from the context menu as well as the path bar menu. But it proved difficult to use the same widget in the path bar menu. 

So, the final solution to all these problems is to use a dialog box for the templates submenu :)
The custom widget is the same, the only difference is that instead of it being a child of the GtkPopoverMenu, it is now implemented in a dialog box!
This is what the final implementation looks like:


All the problems I was facing earlier are resolved by this implementation 🎉

Future plans:
Search is still not fully functional in the dialog box, but should be completed pretty soon. 
After that, naming a template is to be made as part of the process of creating a new template.

Lastly,
I would like to thank my mentor for helping me throughout this project! It has been a really fun experience working with him. 😄

Thanks for reading,
See you in a few weeks! 😉








 

Comments

Popular Posts