Overhaul text tool options.
This switches the old UI file to a QML files that is communicated with through a Manager object that holds both non-persistent options as well as persistent options through a Lager model and data system.
Because the tooloptions docker wants to have the tooloptions widget as small as possible, while the kisquickwidget wants to have the qml root object follow the widget size, this adds a way to have kisquickwidget linked to the implicit size of the rootobject.
Beyond that, this exposes toggles for the text cursor so it can switch between logical and visual mode for bidirectional text, as well as having paste plain text or paste rich text by default.
Finally, it generalizes all the KoResource qml components, moves them to qmlcomponents, and uses them in the new tool options, so we can select style presets to create new texts with.
Issues
-
Theming is broken. It only works after you change the theme, but not upon load. Usual fix doesn't work, probably caused by the widget not being visible right after creation. -
Docs for the generalized components.
Test Plan
Create new text
- With "use current text properties" enabled:
- Go to text properties docker.
- Change some properties (font, for example)
- Create a text.
- Text should have text properties same as docker.
- Without `` enabled:
- Create a style preset in the text properties docker.
- Select it in the dropdown.
- Create a text. It should use the style preset.
Open Text Properties Docker
Because artists may not expect the new text properties docker, I've added a button to open it.
- toggle this
- switch tools
- open or close the properties docker
- come back to text tool
- see if it still toggled.
Options
- Paste Rich Text By Default:
- set some color on some text.
- select said range, copy it.
- paste it, without rich text by default it'll paste plaintext, with it'll paste rich text.
- Use visual bidi cursor.
- Get some bidirectional text.
- Navigate it with left/right keys.
- With visual enabled, it'll follow the visual order, without it'll follow the logical order.
Dialogs:
Same as before.
Convert type:
Also same as before, though they now disable when no text is available.
Debug
Will only show up when "KRITA_DEBUG_TEXTTOOL" is non-empty as an enviroment variable. Both options toggle the debug rectangles that are painted.
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.
