Difference between revisions of "GSoC 2021 Verbs to Gio::Actions"

From Inkscape Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by one other user not shown)
Line 7: Line 7:
Command Palette overall lacks specificity while taking inputs. It would be nice if a hint is given to the user about the input example - Open command Palette > Rotate > 30 ( placeholder = "Enter a double ..."), As In this case the user was not given a hit about the input of angle. It should have been - placeholder =  “Give a real number as input for angle”.
Command Palette overall lacks specificity while taking inputs. It would be nice if a hint is given to the user about the input example - Open command Palette > Rotate > 30 ( placeholder = "Enter a double ..."), As In this case the user was not given a hit about the input of angle. It should have been - placeholder =  “Give a real number as input for angle”.
<br>
<br>
=== Code ===
=== <span style="color:red">Code</span> ===
https://gitlab.com/inkscape/inkscape/-/merge_requests/3328
<span style="font-weight:bold">https://gitlab.com/inkscape/inkscape/-/merge_requests/3328</span>


=== Blog ===
=== Blog ===
Line 27: Line 27:
*  week 8,9 :    Gio::Actions Conversion - Menubar: Filters + Extensions<br>  
*  week 8,9 :    Gio::Actions Conversion - Menubar: Filters + Extensions<br>  
*  week 10 :    Gio::Actions Conversion - Menubar: Layer + Documentation<br>
*  week 10 :    Gio::Actions Conversion - Menubar: Layer + Documentation<br>
== Summary ==
* All the verbs in menubar are converted to actions. This means all the actions can be directly accessed by the command palette and CLI. This project acts as a small step to the conversion of inscape from GTK 3 to GTK 4.
[[File:GioActionsCommandPalette.gif]]
* Now we can get hints in the command palette for inputs, this improves the user experience.
[[File:CommandPaletteInputHint.gif]]
== Challenges Faced ==
* One of the fundamental parts of the project was to understand a large amount of code and reduce its dependencies. This took a lot of time to refactor many functions.
* The main challenge was with extensions and filters. All the data was extracted from many different inx files and add it in the menubar. The addition of these extensions and filters in menubar was a big challenge as there were many ways to do it, After refactoring the current situation is in a good state but can be refactored in the future if a better way is possible.
* For keys, I made a program to convert all the converted verb names to action names, then used some VS Code shortcuts to refactor it.
== Future Plans ==
* Conversion of Toolbars to Gio::Actions and completely deleting the verb class
* Creating a new feature to edit the ui files in a nice GUI, will allow the users to adjust the actions in menubar and toolbars according to their needs.
== Notes ==
== Notes ==



Latest revision as of 14:01, 26 August 2021

This page is a progress tracker for project "verb to Gio::Actions"

Project

About

The biggest problem is that most Verbs require a desktop. This means that they cannot be used in a headless Inkscape. While actions are defined independent of the GUI (unlike GtkAction), they can be used by "actionable widgets" (menus, buttons, etc.) by simply referring to them by name. They can also be remotely activated by D-Bus and GNotifications.Gio::Actions will allow a future GUI-free Inkscape version.
Command Palette overall lacks specificity while taking inputs. It would be nice if a hint is given to the user about the input example - Open command Palette > Rotate > 30 ( placeholder = "Enter a double ..."), As In this case the user was not given a hit about the input of angle. It should have been - placeholder = “Give a real number as input for angle”.

Code

https://gitlab.com/inkscape/inkscape/-/merge_requests/3328

Blog

https://sushantaa.github.io/Blog/VerbAction/

Time Table

Community bonding period

  • Learn more about the codebase
  • Finalizing the Infrastructure design by interacting with #team_dev.
  • Start Coding code Gio::Actions Conversion - Menubar: Objects to get feedback ( June starting )

Coding Period

  • week 1 : Gio::Actions Conversion - Menubar: Objects
  • week 2 : Command Palette Input Improvement
  • week 3 : Gio::Actions Conversion - Menubar: Text
  • week 4 : Gio::Actions Conversion - Menubar: Edit
  • week 5 : Gio::Actions Conversion - Menubar: Help
  • week 6 : Gio::Actions Conversion - Menubar: Path
  • week 7 : Gio::Actions Conversion - Menubar: View (Already Partially Done), Files
  • week 8,9 : Gio::Actions Conversion - Menubar: Filters + Extensions
  • week 10 : Gio::Actions Conversion - Menubar: Layer + Documentation

Summary

  • All the verbs in menubar are converted to actions. This means all the actions can be directly accessed by the command palette and CLI. This project acts as a small step to the conversion of inscape from GTK 3 to GTK 4.

GioActionsCommandPalette.gif

  • Now we can get hints in the command palette for inputs, this improves the user experience.

CommandPaletteInputHint.gif

Challenges Faced

  • One of the fundamental parts of the project was to understand a large amount of code and reduce its dependencies. This took a lot of time to refactor many functions.
  • The main challenge was with extensions and filters. All the data was extracted from many different inx files and add it in the menubar. The addition of these extensions and filters in menubar was a big challenge as there were many ways to do it, After refactoring the current situation is in a good state but can be refactored in the future if a better way is possible.
  • For keys, I made a program to convert all the converted verb names to action names, then used some VS Code shortcuts to refactor it.

Future Plans

  • Conversion of Toolbars to Gio::Actions and completely deleting the verb class
  • Creating a new feature to edit the ui files in a nice GUI, will allow the users to adjust the actions in menubar and toolbars according to their needs.

Notes

Custom widgets used in toolbars:

  • UnitTracker (not really a widget)
  • Units: Selector, Node, Rect, Arc, Calligraphy, Text
  • StyleSwatch: Rect, Arc, Star, Spiral, Pen, Pencil, Calligraphy, PaintBucket, Tweak, LPE,
  • LabelToolItem: Rect, Arc, Star, Spiral, Pencil, Tweak, Measure
  • ComboBoxEntryToolItem
  • ComboToolItemColumns
  • SpinButtonToolItem: Selector, Node, Rect, Arc, Star, 3D, Spiral, Pen, Pencil, Calligraphy, Text, Gradient, Mesh, PaintBucket, Tweak, Spray, Eraser, Connector, Measure.

The last four are just wrappers around normal widgets. GTK4 has removed the Gtk::Toolbar widget. One can just use a Gtk::Box and put the widgets in directly. This might be worth trying now.

Links