From f8fe30e68719b16d83bc92530c6951d9cdb11268 Mon Sep 17 00:00:00 2001 From: Simone Gaiarin Date: Sat, 24 Oct 2020 15:14:36 +0200 Subject: [PATCH] Do not show annotation toolbar when quick annotation tool is selected --- part/annotationactionhandler.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/part/annotationactionhandler.cpp b/part/annotationactionhandler.cpp index 6f6a9e30b..403ff2684 100644 --- a/part/annotationactionhandler.cpp +++ b/part/annotationactionhandler.cpp @@ -100,6 +100,7 @@ public: void slotSetColor(AnnotationColor colorType, const QColor &color = QColor()); void slotSelectAnnotationFont(); void slotToolBarVisibilityChanged(bool checked); + bool isQuickToolAction(QAction *aTool); AnnotationActionHandler *q; @@ -493,6 +494,11 @@ void AnnotationActionHandlerPrivate::slotToolBarVisibilityChanged(bool checked) } } +bool AnnotationActionHandlerPrivate::isQuickToolAction(QAction *aTool) +{ + return quickTools->contains(aTool); +} + AnnotationActionHandler::AnnotationActionHandler(PageViewAnnotator *parent, KActionCollection *ac) : QObject(parent) , d(new AnnotationActionHandlerPrivate(this)) @@ -657,8 +663,10 @@ AnnotationActionHandler::AnnotationActionHandler(PageViewAnnotator *parent, KAct d->selectTool(-1); } else { d->agLastAction = action; - // Show the annotation toolbar whenever actions are triggered (e.g using shortcuts) - d->aShowToolBar->setChecked(true); + // Show the annotation toolbar whenever builtin tool actions are triggered (e.g using shortcuts) + if (!d->isQuickToolAction(action)) { + d->aShowToolBar->setChecked(true); + } } });