Commit dea517bb authored by Nate Graham's avatar Nate Graham
Browse files

Use icons-only "Show Sidebar" Button with new icon, if available

This commit makes the "Show Sidebar" button that's on the toolbar by
default use the new `sidebar-expand` icon, if present. If not, it falls
back to the old `view-sidetree` icon for compatibility's sake.

We also make thie button icons-only by default, as the new icon is
clearer than the old one. This saves some horizontal space in the
defualt toolbar, which is now quite wide.
parent e6dae5d4
Pipeline #58083 passed with stage
in 9 minutes and 2 seconds
......@@ -861,7 +861,8 @@ void Part::setupActions()
m_showLeftPanel = ac->add<KToggleAction>(QStringLiteral("show_leftpanel"));
m_showLeftPanel->setText(i18n("Show S&idebar"));
const QString preferredSidebarIcon = m_sidebar->layoutDirection() == Qt::LeftToRight ? QStringLiteral("sidebar-expand-left") : QStringLiteral("sidebar-expand-right");
m_showLeftPanel->setIcon(QIcon::fromTheme(preferredSidebarIcon, QIcon::fromTheme(QStringLiteral("view-sidetree"))));
connect(m_showLeftPanel, &QAction::toggled, this, &Part::slotShowLeftPanel);
ac->setDefaultShortcut(m_showLeftPanel, QKeySequence(Qt::Key_F7));
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui name="okular_part" version="48">
<gui name="okular_part" version="49">
<Menu name="file"><text>&amp;File</text>
<Action name="get_new_stuff" group="file_open"/>
......@@ -110,6 +110,9 @@
<Action name="zoom_to" />
<Action name="view_zoom_in"/>
<ActionProperties scheme="Default">
<Action priority="0" name="show_leftpanel"/>
<ToolBar name="annotationToolBar" iconText="icononly" newline="true" hidden="true"><text>Annotation Toolbar</text>
<Action name="annotation_highlighter"/>
<Action name="annotation_underline"/>
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