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.
remotes/origin/work/spdx
Nate Graham 5 years ago
parent e6dae5d4f9
commit dea517bb69
  1. 3
      part/part.cpp
  2. 5
      part/part.rc

@ -861,7 +861,8 @@ void Part::setupActions()
m_showLeftPanel = ac->add<KToggleAction>(QStringLiteral("show_leftpanel"));
m_showLeftPanel->setText(i18n("Show S&idebar"));
m_showLeftPanel->setIcon(QIcon::fromTheme(QStringLiteral("view-sidetree")));
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));
m_showLeftPanel->setChecked(Okular::Settings::showLeftPanel());

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui name="okular_part" version="48">
<gui name="okular_part" version="49">
<MenuBar>
<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"/>
</ToolBar>
<ActionProperties scheme="Default">
<Action priority="0" name="show_leftpanel"/>
</ActionProperties>
<ToolBar name="annotationToolBar" iconText="icononly" newline="true" hidden="true"><text>Annotation Toolbar</text>
<Action name="annotation_highlighter"/>
<Action name="annotation_underline"/>

Loading…
Cancel
Save