Queries regarding adding a new 'typewriter' annotation tool to the toolbar

Dileep Sankhla sankhla.dileep96 at gmail.com
Fri May 18 15:04:09 UTC 2018


Hello everyone,

I'm working on my GSoC project[0] with my mentor Tobias Deiminger
<haxtibal[at]posteo[dot]de> and I need to add a new 'typewriter' tool to
the annotation toolbar with a new icon and a setting dialogue to customize
its font [and font color].

I have few things to ask before getting it done and it would be nice if you
can reply to any of the queries with your own suggestions.

1. In tree/ui/data/tools.xml, we have decided to append new "typewriter"
annotation tool at <tool id="10"> without muddling others. Now should I
give <shortcut>0</shortcut> to this tool or should I ommit the <shortcut>
tag completely for this one?
Giving shortcut 0 makes sense as 0 is the key next to 9 on the keyboard but
having shortcut 0 for the tool at the lowest end in the annotation toolbar
doesn't make sense.

2. My mentor remarked that tools.xml doesn't solely determine the order in
the toolbar. It is just the initial default, but the "okularpartrc" file,
if present, takes precedence.
It is located at ~/.config/okularpartrc on my system containing the content
similar to tools.xml. I need to know when it is being created and read by
okular and how do I append typewriter tool entry in it for every system
installing okular? I have no idea.

3. Inline note has a "hover icon" (see tools.xml) which is shown when a
dashed line block is drawn while dragging the mouse to create a note. Do we
also need a different hover icon for typewriter or should we get rid of it?
In my opinion, we should get rid of it instead of creating a new hover icon
for typewriter. What do you say?

4. In Okular::Annotation::Style::setColor(const QColor &color), it sets
d->m_color = color (see tree/core/annotations.cpp. Here d is just a pointer
to a class Private). Does it save color in some config/xml file as the
previously set annotation color is always there whenever you close and open
okular? I'm unable to find class Private.

5. Do I need to implement "font color" for the typewriter annotation
(didn't propose in my proposal) or we fine with the regular black font?
This follows the next query.

6. tools.xml has <engine color> and <annotation color> tags. The engine
color is used -
i) to colorize the overlay icon with engine color that is drawn
on tool-base-okular icon for every annotation toolbar icon[1].
ii) to set annotation background color to engine color if <annotation
color> tag is absent[2].
It is clear that we should omit <annotation color> tag and wherever it is
calling Okular::Annotation::Style::setColor() function, we should pass
QColor(255,255,255,0) //alpha is 0, so transparent
But we need engineColor to colorize our overlay icon. We can't omit it.

6.1 We want to set overlay icon's color as the current font color being set
for typewriter only if we implement font color. Else we will have a black
colored icon. So if the community agrees on implementing the font color
feature, do I need to first demo this with typewriter icon? Or should we
agree on black font and implement it only when the font color feature is
done?
I don't know how to make a demo. Maybe something like
Okular::Annotation::Style::setFontColor() which will save color in private
data without applying it to the annotation and set a demo by simply
choosing, saving, reading font color and set the same icon color? This is
how we do for annotation color but here not applying to the annotation at
all.

6.2 Now engineColor is also responsible for annotation color, which we want
transparent. I don't know if <annotation color="#00ffffff"> will set it to
transparent or should we omit this tag?
Basically, annotation color is set as a common attribute to all annotation
types at the end of the file and if we should bypass it with an if
condition that will set annotation color for type "typewriter" hardcoded to
QColor(255,255,255,0).
I have tried harcoding it for inline note and in the appearance settings, I
got a transparent color but as soon as I create a note, it's background
turns to white. and I find color: white in the appearance settings again.
Will it work for the typewriter then?

7. Are you agree on simple 'T' icon with some thickness and border black
that will be either black or filled with the engine color? It will be drawn
in the middle of okular base icon.
If we copy the Adobe Reader typewriter icon, please note that it is not a
simple 'T'.  It has bents sideways and at the bottom. See image[3].

Thanks and Regards
Dileep

[0] https://summerofcode.withgoogle.com/projects/#6053164340477952
[1] https://cgit.kde.org/okular.git/tree/ui/pageviewannotator.cpp#n1180
[2] https://cgit.kde.org/okular.git/tree/ui/pageviewannotator.cpp#n280
[3]
http://data.answerbase.com/Adobe/answers.acrobatusers.com/UserFiles/Answers201403/answerImage91278-05020444.jpg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180518/537d317a/attachment-0001.html>


More information about the Okular-devel mailing list