Ten Scripts plug-in: maintain absolute position and link with shortcut key
This is a merge request for a small quality-of-life improvement for the 'Ten Scripts' plug-in.
Background
I'm coming from Photoshop, and I missed the Shift+F5 fill action. I made a script for Krita to get similar functionality, and used Ten Scripts to have it assigned to a shortcut key. I changed the shortcut key of the 5th slot from Ctrl+Shift+5
to Shift+F5
, and assigned my script.
Before choosing 'OK', the dialog box looked like this:
After choosing 'OK', the actual order of the scripts has changed, and the associated shortcut keys changed with it:
Though not a big deal, it was not what I expected based on the UI.
Changes
I've modified the plug-in a little, such that scripts now stay in the slot that they were assigned, regardless of whether there are empty slots in between. Additionally, one can clear a slot with an extra button next to the text field:
Test Plan
I did not test anything that requires building Krita from source code, as I don't have that environment set up. I only tested against a ready-made binary of Krita 5.2.3 on Windows 10. I manually tested everything on the Python/plug-in side that I could think of, as I don't think there are Pytest files for this plug-in? If possible, I'd prefer to have this code tested on other operating systems as the file system is involved with paths to scripts.
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. -
Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?
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.