<table><tr><td style="">simgunz marked 2 inline comments as done.<br />simgunz added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15580">View Revision</a></tr></table><br /><div><div><p>I need some input on two things left to be done:</p>

<ol class="remarkup-list">
<li class="remarkup-list-item">When a color picker is open and the user presses <tt style="background: #ebebeb; font-size: 13px;">Esc</tt>, the color picker modal dialog is closed but the currently selected annotation action is deselected when it should not. It is not to clear to me how to prevent the propagation of the KeyPressEvent. In <tt style="background: #ebebeb; font-size: 13px;">PageView::event</tt> the event is never stopped, even if it was already accepted and when it reaches <tt style="background: #ebebeb; font-size: 13px;">PageView::keyReleaseEvent</tt> I cannot tell if it was accepted by the color picker or not. Any idea on how to solve this?</li>
</ol>

<ol class="remarkup-list" start="2">
<li class="remarkup-list-item">I want to add the action <tt style="background: #ebebeb; font-size: 13px;">mouse_toggle_annotate</tt> (to show/hide the annotation toolbar) to the <tt style="background: #ebebeb; font-size: 13px;">Quick Annotations</tt> action in the main toolbar. There are two problems:<ul class="remarkup-list">
<li class="remarkup-list-item">how to retrieve the <tt style="background: #ebebeb; font-size: 13px;">mouse_toggle_annotate</tt> from within <tt style="background: #ebebeb; font-size: 13px;">AnnotationActionHandlerPrivate::populateQuickAnnotations</tt>. My current solution is the following, but I am not sure it is the best one:</li>
</ul></li>
</ol>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">QAction * aToggleAnnotator = qobject_cast<KParts::MainWindow *>(KParts::MainWindow::memberList()[0])->actionCollection()->action( "mouse_toggle_annotate" );
if ( aToggleAnnotator ) {
    aQuickTools->addAction( aToggleAnnotator );
}</pre></div>

<ul class="remarkup-list">
<li class="remarkup-list-item">The first time that <tt style="background: #ebebeb; font-size: 13px;">AnnotationActionHandlerPrivate::populateQuickAnnotations</tt> is reached the <tt style="background: #ebebeb; font-size: 13px;">mouse_toggle_annotate</tt> action does not exist yet because the <tt style="background: #ebebeb; font-size: 13px;">KPart</tt> is created before <tt style="background: #ebebeb; font-size: 13px;">setupActions</tt> is called in <tt style="background: #ebebeb; font-size: 13px;">shell.cpp</tt>. I can manually invoke <tt style="background: #ebebeb; font-size: 13px;">Part::slotNewConfig()</tt> after <tt style="background: #ebebeb; font-size: 13px;">setupActions</tt> has been called, but does not seem a nice solution.</li>
</ul>

<p><a href="https://phabricator.kde.org/p/aacid/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@aacid</a> Your help would be appreciated :-)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15580">https://phabricator.kde.org/D15580</a></div></div><br /><div><strong>To: </strong>simgunz, Okular, VDG<br /><strong>Cc: </strong>simgunz, ltoscano, cfeck, aacid, davidhurka, knambiar, ngraham, tobiasdeiminger, okular-devel, andisa, siddharthmanthan, maguirre, fbampaloukas, joaonetto, kezik, tfella, darcyshen<br /></div>