<div dir="ltr"><img width="0" height="0" class="mailtrack-img" alt="" style="display:flex" src="https://mailtrack.io/trace/mail/908eeaf57de6a5c1715b69e4dc27c1f5308c1b6d.png?u=1477559"><div></div>Hello everyone,<div><br></div><div>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].</div><div> </div><div>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.</div><div><br></div><div>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?</div><div>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. </div><div><br></div><div>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.</div><div>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.</div><div><br></div><div>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?</div><div>In my opinion, we should get rid of it instead of creating a new hover icon for typewriter. What do you say?</div><div><br></div><div>4. In Okular::Annotation::Style::setColor(const QColor &color), it sets d->m_color = color (see tree/core/annotations.cpp. H<span class="gmail-gr_ gmail-gr_2502 gmail-gr-alert gmail-gr_gramm gmail-gr_inline_cards gmail-gr_disable_anim_appear gmail-Grammar gmail-only-ins gmail-doubleReplace gmail-replaceWithoutSep" id="gmail-2502" style="display:inline;color:rgb(34,34,34);font-size:small;border-bottom:2px solid transparent;background-repeat:no-repeat;font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">ere</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> d is just a pointer to a class Private</span>). 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.</div><div><br></div><div>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.</div><div><br></div><div>6. tools.xml has <engine color> and <annotation color> tags. The engine color is used -</div><div>i) to colorize the overlay icon with engine color that is drawn on tool-base-okular icon for every annotation toolbar icon[1].</div><div>ii) to set annotation background color to engine color if <annotation color> tag is absent[2].</div><div>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</div><div>But we need engineColor to colorize our overlay icon. We can't omit it. </div><div><br></div><div>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? </div><div>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.</div><div><br></div><div>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?</div><div>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).</div><div>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?</div><div><br></div><div>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.</div><div>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].</div><div><br></div><div>Thanks and Regards</div><div>Dileep</div><div><br></div><div>[0] <a href="https://summerofcode.withgoogle.com/projects/#6053164340477952">https://summerofcode.withgoogle.com/projects/#6053164340477952</a><br>[1] <a href="https://cgit.kde.org/okular.git/tree/ui/pageviewannotator.cpp#n1180">https://cgit.kde.org/okular.git/tree/ui/pageviewannotator.cpp#n1180</a></div><div>[2] <a href="https://cgit.kde.org/okular.git/tree/ui/pageviewannotator.cpp#n280">https://cgit.kde.org/okular.git/tree/ui/pageviewannotator.cpp#n280</a><br>[3] <a href="http://data.answerbase.com/Adobe/answers.acrobatusers.com/UserFiles/Answers201403/answerImage91278-05020444.jpg">http://data.answerbase.com/Adobe/answers.acrobatusers.com/UserFiles/Answers201403/answerImage91278-05020444.jpg</a><br></div></div>