From c79244455050c2f2bfe8c629b43fbc1b54814c08 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Thu, 6 Jun 2019 08:18:39 -0600 Subject: [PATCH] Use a more conventional dropdown menu style instead of press-and-hold Summary: Currently, `ToolAction` menus (of which there is only one, the selection tool menu) activate the current tool on click, and require a click-and-hold to choose a new tool. This is a somewhat unfamiliar user interface that I myself struggled with when initially encountering it, and I've encountered user complaints about it as well. This patch adjusts the behavior so that clicking on the arrow on the right side of the button will open the pop-up and allow choosing another tool, which is a more common method of implementing the feature. The patch also adjusts the tooltop accordingly. Test Plan: {F6874466, size=full} Reviewers: #okular, #vdg, ndavis Reviewed By: #vdg, ndavis Subscribers: ndavis, abetts, filipf, okular-devel Tags: #okular Differential Revision: https://phabricator.kde.org/D21622 --- ui/toolaction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/toolaction.cpp b/ui/toolaction.cpp index d2dc77454..16743e392 100644 --- a/ui/toolaction.cpp +++ b/ui/toolaction.cpp @@ -49,7 +49,7 @@ QWidget* ToolAction::createWidget( QWidget *parent ) button->setFocusPolicy( Qt::NoFocus ); button->setIconSize( toolBar->iconSize() ); button->setToolButtonStyle( toolBar->toolButtonStyle() ); - button->setPopupMode( QToolButton::DelayedPopup ); + button->setPopupMode( QToolButton::MenuButtonPopup ); button->setMenu( new QMenu( button ) ); button->setCheckable( true ); connect(toolBar, &QToolBar::iconSizeChanged, button, &QToolButton::setIconSize); @@ -68,7 +68,7 @@ QWidget* ToolAction::createWidget( QWidget *parent ) if ( action->isChecked() ) button->setDefaultAction( action ); } - button->setToolTip( i18n("Click to use the current selection tool\nClick and hold to choose another selection tool") ); + button->setToolTip( i18n("Click to use the current selection tool\nClick on the arrow to choose another selection tool") ); } return button; @@ -80,7 +80,7 @@ void ToolAction::slotNewDefaultAction( QAction *action ) if ( button ) { button->setDefaultAction( action ); - button->setToolTip( i18n("Click to use the current selection tool\nClick and hold to choose another selection tool") ); + button->setToolTip( i18n("Click to use the current selection tool\nClick on the arrow to choose another selection tool") ); } }