Commit 435d2ad1 authored by Nate Graham's avatar Nate Graham 💤
Browse files

Give Exit Full Screen and Configure buttons text and adjust wording

Summary:
Unlike Kate, Gwenview's {nav Exit Full Screen} button is icons-only, impeding
discoverability. This patch shows its action's text, and adjusts that text to be more
consistent with the typical wording.

In the process, the button below it is also given visible text to avoid making it look
odd in its layout.

To accomplish this technically, the `FullScreenToolBar` class's `addAction()` function
is given a new optional parameter for specifying if and where the button's text should
appear, which is then used to give the aforementioned buttons visible text according to
the user's toolbutton text display preferences. The actions are also no longer marked
with the Low Priority status, which forces them to be always icons-only and was
previously redundant since icons-only status was forced in a different way. Fixed now.

BUG: 385314
FIXED-IN: 20.04.0

Test Plan: {F8176526}

Reviewers: #gwenview, #vdg, broulik

Reviewed By: broulik

Tags: #gwenview

Differential Revision: https://phabricator.kde.org/D28052
parent cf4ce008
......@@ -72,11 +72,11 @@ public:
mLayout->setContentsMargins(0, 0, 0, 0);
}
void addAction(QAction* action)
void addAction(QAction* action, Qt::ToolButtonStyle style = Qt::ToolButtonIconOnly)
{
QToolButton* button = new QToolButton;
button->setDefaultAction(action);
button->setToolButtonStyle(Qt::ToolButtonIconOnly);
button->setToolButtonStyle(style);
button->setAutoRaise(true);
const int extent = KIconLoader::SizeMedium;
button->setIconSize(QSize(extent, extent));
......@@ -196,8 +196,8 @@ void FullScreenContent::init(KActionCollection* actionCollection, QWidget* autoH
// Right bar
mRightToolBar = new FullScreenToolBar(mContent);
mRightToolBar->addAction(mActionCollection->action("leave_fullscreen"));
mRightToolBar->addAction(mOptionsAction);
mRightToolBar->addAction(mActionCollection->action("leave_fullscreen"), Qt::ToolButtonFollowStyle);
mRightToolBar->addAction(mOptionsAction, Qt::ToolButtonFollowStyle);
mRightToolBar->addStretch();
mRightToolBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
mRightToolBarShadow = new ShadowFilter(mRightToolBar);
......@@ -407,8 +407,8 @@ void FullScreenContent::createOptionsAction()
// if the mode is changed to thumbnail-mode, we want the option button
// to remain visible
mOptionsAction = new QAction(this);
mOptionsAction->setPriority(QAction::LowPriority);
mOptionsAction->setIcon(QIcon::fromTheme("configure"));
mOptionsAction->setText(i18n("Configure"));
mOptionsAction->setToolTip(i18nc("@info:tooltip", "Configure full screen mode"));
QObject::connect(mOptionsAction, &QAction::triggered, this, &FullScreenContent::showOptionsMenu);
}
......
......@@ -439,8 +439,7 @@ struct MainWindow::Private
QAction * leaveFullScreenAction = view->addAction("leave_fullscreen", q, SLOT(leaveFullScreen()));
leaveFullScreenAction->setIcon(QIcon::fromTheme("view-restore"));
leaveFullScreenAction->setPriority(QAction::LowPriority);
leaveFullScreenAction->setText(i18nc("@action", "Leave Fullscreen Mode"));
leaveFullScreenAction->setText(i18nc("@action", "Exit Full Screen"));
mGoToPreviousAction = view->addAction("go_previous", q, SLOT(goToPrevious()));
mGoToPreviousAction->setPriority(QAction::LowPriority);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment