Bug 330518 - Add configure icon to the annotation toolbar
Summary: Add configure icon to the annotation toolbar
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2014-01-28 20:42 UTC by Albert Astals Cid
Modified: 2020-06-04 13:01 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.11.0


Attachments
Screenshot showing where the icon should go (617.84 KB, image/png)
2014-07-14 22:41 UTC, Albert Astals Cid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Astals Cid 2014-01-28 20:42:37 UTC
Lots of people don't know they can configure annotations, adding a small configure icon to the annotation toolbar (ideally near the handle) would help with discoverability
Comment 1 Abhijeet Nikam 2014-04-08 20:00:22 UTC
Hi!
I have tried working on the bug and have submitted a patch. Can somebody please review it and provide feedback for me to improve it?

https://git.reviewboard.kde.org/r/117306/
Comment 2 Christoph Feck 2014-04-21 12:46:28 UTC
Thanks for the patch, but it cannot be applied before the 4.14 release, which will be prepared during May and June. If you get no feedback until the first week of June, please add a comment (either here, or to the reviewboard).
Comment 3 Perminov Fedor 2014-05-04 13:22:00 UTC
Hi, I'm also working on this bug as part of a course project at my university can look at my solution, maybe it's like you. You will have a choice, which solution is better to use.
Comment 4 Albert Astals Cid 2014-05-04 13:35:55 UTC
Honestly I prefer you don't duplicate work someone else is already doing.
Comment 5 Albert Astals Cid 2014-07-14 22:41:29 UTC
Created attachment 87732 [details]
Screenshot showing where the icon should go
Comment 6 Nate Graham 2017-08-17 23:07:17 UTC
Looks like that patch never made it in, so this request is still available for people to work on.
Comment 7 Nate Graham 2020-06-04 13:01:34 UTC
Git commit 0b05d7ce990c1b5e17397f1515ba0364a773a43f by Nate Graham, on behalf of Simone Gaiarin.
Committed on 04/06/2020 at 13:01.
Pushed by ngraham into branch 'master'.

Overhaul annotations UX

Create a new new annotation toolbar to replace the current one as discussed in the task T8076.
Fixes:
Related: bug 386578, bug 374728, bug 352310, bug 341914, bug 157289, bug 358057, bug 412767, bug 413595, bug 420462
FIXED-IN: 1.11.0

Test Plan
Before testing this revision
Delete or Temporary move aside the following files:

~/.config/okularpartrc
~/.config/okularrc
~/.local/share/kxmlgui5/okular/part.rc
~/.local/share/kxmlgui5/okular/shell.rc

Nomenclature
Actions in the main toolbar:

Quick annotations
Actions in the annotation toolbar:

Annotation actions Highlighter, Underline, Squiggle, Strike out, Typewriter,
Inline note, Popup note, Freehand line, Arrow, Straight line, Rectangle, Ellipse,
Polygon, Stamp

Annotation config actions Line width, Color, Inner color, Opacity, Font, Annotation settings

Other actions Add to Quick Annotations, Pin

Autotests

 First run: annotation toolbar is not visible

 Selecting Tools > Annotations shows the annotation toolbar (below the main toolbar by default)

 Select an annotation > toolbar is shown

 Select a quick annotation > toolbar is shown

 Hide action (red cross) on the toolbar hides the toolbar

 Keys 1-9,0 select the (builtin) Annotation actions (one case tested)

 Keys Alt+1-9,0 select the quick annotation actions (one case tested)

 No annotation action selected: Quick Annotations is enabled, Add to quick annotations is disabled, Annotation config actions are disabled, Pin is enabled

 The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled (also in Quick annotations)

 The current document is protected: All actions are disabled

 Select annotation: the  Annotation config actions are enabled and their values set to the ones for the current annotation (taken from okularpartrc)

 Click an annotation action when none selected: browse mode is selected

 Click the currently selected annotation action: the action is unchecked and the tool disabled (back to browse mode)

 Click ESC: the currently selected annotation action is unchecked

 If Pin unchecked the selected annotation is unchecked after it has be used once and we are back to Browse mode

 The annotation systems works when multiple Okular tabs are open (the selected annotation is per-tab)

Manual tests

(TODO) Check that kconf_update updates the key AnnotationTools to QuickAnnotationTools in ~/.config/okularpartrc

Color icon is a format-text-color (if inline note or typewriter) or format-stroke-color for all other annotations
All actions have tooltips (some change based on the fact that the icon is enabled or not)
If a custom Line Width or Opacity is set through the Annotation Settings dialog, its value appears as a new checked action in the Line width or Opacity menu
If a custom stamp is selected through the Annotation Settings dialog, its name or filename (without path) appears as a new checked action in the Stamp menu
In Configure Okular > Annotations it is only possible to configure the quick annotations. Modifying them here updates the Quick annotations list after clicking Apply

The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled in Quick annotations
The state of Pin action is remembered across Okular launches
Selecting a quick action selects the corresponding action and loads its config values (color, line width, ...)
Setting the color and fill color works for all annotations (to be tested carefully, can be problematic for typewriter and inline note given the different internal mechanism to store the color in the settings)
Test stamp annotation (handled differently from the rest of the annotations)

Merge Request: https://invent.kde.org/graphics/okular/-/merge_requests/105

M  +2    -1    CMakeLists.txt
M  +7    -0    autotests/CMakeLists.txt
A  +373  -0    autotests/annotationtoolbartest.cpp     [License: GPL (v2+)]
A  +-    --    autotests/data/protected.pdf
M  +9    -16   autotests/parttest.cpp
M  +3    -3    conf/dlgannotations.cpp
M  +1    -1    conf/dlgannotationsbase.ui
M  +7    -2    conf/editannottooldialog.cpp
M  +5    -1    conf/editannottooldialog.h
M  +41   -0    conf/okular.kcfg
M  +5    -0    okular.upd
M  +3    -1    part.cpp
M  +26   -1    part.rc
M  +3    -3    shell/shell.cpp
M  +1    -0    shell/shell.h
A  +837  -0    ui/annotationactionhandler.cpp     [License: GPL (v2+)]
A  +51   -0    ui/annotationactionhandler.h     [License: GPL (v2+)]
M  +45   -22   ui/annotationwidgets.cpp
M  +6    -0    ui/annotationwidgets.h
M  +1    -0    ui/data/CMakeLists.txt
M  +104  -55   ui/data/tools.xml
A  +33   -0    ui/data/toolsQuick.xml
M  +28   -126  ui/pageview.cpp
M  +3    -2    ui/pageview.h
M  +314  -157  ui/pageviewannotator.cpp
M  +62   -26   ui/pageviewannotator.h
M  +2    -533  ui/pageviewutils.cpp
M  +0    -95   ui/pageviewutils.h
M  +2    -2    ui/side_reviews.cpp

https://invent.kde.org/graphics/okular/commit/0b05d7ce990c1b5e17397f1515ba0364a773a43f