The current annotation toolbar is not very flexible and can benefit from some modernization.
Some of the problems are:
- Custom toolbar UI not integrated with the other Qt toolbars
- Impossibility to change the color/font of the annotations on the fly (it is necessary to create a new tool with the desired color/font)
- Some tools are missing from the toolbar by default (e.g. squiggle underline, delete text, rectangle, ...)
- To keep an annotation tool selected one need to double click on an annotation (not intuitive/no tips for the user) (BUG: 358057)
- Incoherence between annotation icons used and one in config dialogs (BUG: 358065)
Note: This task has evolved from problems in the annotation configuration dialogs to usability problems in the annotation toolbar itself.
**To-do**
- [x] Select and use text annotations (highlighter, underline, squiggle, strike out)
- [x] Select and use note annotations (typewriter, inline note, popup note)
- [x] Select and use drawing annotations (freehand line, straight line, rectangle, ellipse, polygon)
- [ ] Select and use stamp annotation (see also T8074) [possibly disable this button for PDF documents, see 383651]
- [x] Pin annotation / The annotation remains selected after use if the pin button is checked
- [x] Change (outer) color and opacity of annotations [Draft code in place for now]
- [x] Change inner color and opacity of annotations
- [x] Change size of lines (freehand, straight line, geometrical shapes)
- [x] Change icon of popup note
- [x] Change font of notes annotations (typewriter, inline note, popup note?)
- [x] Change straight line line extensions ( via Advanced settings)
- [x] Add mechanism to save annotation tools with custom options (favorite tools) See T8076#186855
- [x] Save state of pin action
- [x] Prevent changing the annotation type of builtin annotations, when using the advanced setting menu (wait for D10859)
- [ ] Add real value of opacity to the list of action if it is not one of the default values (e.g. if it was set with the advanced settings menu) ] Add favorite tools action context menu entry to open favorite annotation config dialog
- [x] Save state of pin action
- [ ] Make color selectors a list- [x] Prevent changing the annotation type of default colors with an option to select a custom color via a FileChooserbuiltin annotations, when using the advanced setting menu (wait for D10859)
- [ ] Use proper icons for all annotation (see BUG: [[ https://bugs.kde.org/show_bug.cgi?id=408283 | 408283 ]]x] Add real value of opacity and line width to the list of action if it is not one of the default values (e.g. if it was set with the advanced settings menu)
- [x] Set width combo icons (generate programatically see D21364#469241)
- [x] Activate line width action in one click (not just clicking on the down arrow)
- [x] Click on a selected annotation should deselect it (see https://codereview.qt-project.org/c/qt/qtbase/+/255770)
- [x] Selecting an annotation should switch to Browse mode
- [x] Set default location of annotation toolbar under the main toolbar
- [x] Show/hide toolbar from menu
- [ ] Default toolbar aspect should be icons only or text alongside icons? (in this second case we need to shrink it)
- [ - [x] Set meaningful default shortcuts for implicit and/or explicit tools
- [x] Set tooltips everywhere
- [x] Add i18nc everywhere
- [x] Reimplement code to enable/disable tools or text tools if document not editable
- [ ] Remove legacy code left hanging around after the changes
- [x] Rename and move PageViewToolBar, not part of PageView anymore
- [ ] Update documentation
- [ ] Properly manage the upgrade of the configuration file during the upgrade of okular (in particular the `AnnotationTools` key).
~~Most of the annotation configuration dialogs have misaligned label and unuseful group boxes.~~
~~Popup note:~~
~~- Remove "Icon" group box and make it a row in the grid layout~~
~~- Preview image under combo box~~
~~Inline note:~~
~~- Align 3 bottom labels on the right~~
~~- Align 2 top and 3 bottom labels~~
~~Freehand line:~~
~~- Remove "Style" group box~~- [ ] Remove legacy code left hanging around after the changes
~~- Make size an entry in the grid~~- [x] Properly manage the upgrade of the configuration file during the upgrade of okular (in particular the `AnnotationTools` key).
~~Straight line:~~**Discuss**
~~- Remove group boxes~~- [ ] Default toolbar aspect should be icons only or text alongside icons? (in this second case we need to shrink it)
~~Polygon:~~**Delegate**
~~- Remove group boxes~~- [ ] Create proper icons for all annotation (see BUG: [[ https://bugs.kde.org/show_bug.cgi?id=408283 | 408283 ]])
~~- Split inner color config in: Enabled check box + Color picker (in 2 lines)~~- [ ] Update documentation
~~Geometrical shape:~~**Future improvements**
~~- Split inner- [ ] Make color config in: Enabled check box + Color picker (in 2 lines)~~
~~Stamp:~~selectors a list of default colors with an option to select a custom color via a FileChooser
~~- Remove group box~~