D15580: [WIP] New annotation toolbar
Simone Gaiarin
noreply at phabricator.kde.org
Thu Oct 10 08:02:12 BST 2019
simgunz marked 2 inline comments as done.
simgunz added a comment.
I need some input on two things left to be done:
1. When a color picker is open and the user presses `Esc`, 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 `PageView::event` the event is never stopped, even if it was already accepted and when it reaches `PageView::keyReleaseEvent` I cannot tell if it was accepted by the color picker or not. Any idea on how to solve this?
2. I want to add the action `mouse_toggle_annotate` (to show/hide the annotation toolbar) to the `Quick Annotations` action in the main toolbar. There are two problems:
- how to retrieve the `mouse_toggle_annotate` from within `AnnotationActionHandlerPrivate::populateQuickAnnotations`. My current solution is the following, but I am not sure it is the best one:
QAction * aToggleAnnotator = qobject_cast<KParts::MainWindow *>(KParts::MainWindow::memberList()[0])->actionCollection()->action( "mouse_toggle_annotate" );
if ( aToggleAnnotator ) {
aQuickTools->addAction( aToggleAnnotator );
}
- The first time that `AnnotationActionHandlerPrivate::populateQuickAnnotations` is reached the `mouse_toggle_annotate` action does not exist yet because the `KPart` is created before `setupActions` is called in `shell.cpp`. I can manually invoke `Part::slotNewConfig()` after `setupActions` has been called, but does not seem a nice solution.
@aacid Your help would be appreciated :-)
REPOSITORY
R223 Okular
REVISION DETAIL
https://phabricator.kde.org/D15580
To: simgunz, #okular, #vdg
Cc: simgunz, ltoscano, cfeck, aacid, davidhurka, knambiar, ngraham, tobiasdeiminger, okular-devel, andisa, siddharthmanthan, maguirre, fbampaloukas, joaonetto, kezik, tfella, darcyshen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20191010/33a24016/attachment.html>
More information about the Okular-devel
mailing list