Skip to content

Assistant Tool New features: Editor Widget Redesign and Duplication Function

Implemented two new features in the Assistant Tool:

  1. Dynamic editor widget. Allows the user to decide what buttons to display on the editor widget and resizes to accommodate the user's choice.
  2. A duplication button. Allows the user to duplicate a given assistant.(F152)

Editor widget redesign: assitant-redesign-update update-drag-decoration

Editor widget button control panel: editor-widget-control

Old vs new editor widget design: assistant_old assistant_new

Duplication Feature: assitant-duplication-update

To implement these features, I have made two basic changes to the code-base:

  1. I added a function to the KisPaintingAssistant class which allows a derived class to create a new SharedData struct from the SharedData struct of another derived class. This is necessary for full duplication, as the virtual clone function does not copy this struct.

  2. I wanted the editor widget to dynamically position buttons. As a result the AssistantEditorData could no longer be a static struct, but a singular structure accessible to any class needing its information. The struct primarily holds data relevant to handling mouse interaction and rendering for the editor widget. To make this data accessible to the relevant classes, I made the struct a member of the KisPaintingAssistantsDecoration class.

  3. To support easy button expansion, I reorganized the code in a more modular and logical way. Because the user has the option to enable/disable buttons, the code for drawing/interacting with the buttons are within conditional code-blocks. The new organization makes it easy for a developer to add new buttons to the editor widget.

Note: This commit contains two features. I considered keeping them separate, but the addition of a new duplication button made a redesign of the editor widget necessary as the widget was getting too crowded.

I started a discussion on Thread.

This is my first Merge Request, so please let me know if there are any issues.😄

@teams/qa @teams/vdg @teams/usability

Simply run the build and start creating assistants. The editor widget now has a duplication button that the user clicks and drags to duplicate a chosen assistant. The user can also click check-boxes on the Tool Panel to enable/disable buttons on the editor widget.

I run a Fedora based system and this project was built within docker following the instructions given in

NOTE: I tried running the unit tests for the Assistant Tool, but they couldn't initialize properly.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Edited by Aries Moczar

Merge request reports

Loading