Commit 6e1832d5 authored by con's avatar con

Update tool tip text for "Show / Hide Sidebar" wrt current state.

parent fec9dc0e
......@@ -716,6 +716,7 @@ void MainWindow::registerDefaultActions()
tr("Show Sidebar"), this);
m_toggleSideBarAction->setCheckable(true);
cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, m_globalContext);
cmd->setAttribute(Command::CA_UpdateText);
#ifdef Q_WS_MAC
cmd->setDefaultKeySequence(QKeySequence("Ctrl+0"));
#else
......
......@@ -163,10 +163,19 @@ int NavigationWidget::storedWidth()
return m_width;
}
void NavigationWidget::updateToggleText()
{
if (isShown())
m_toggleSideBarAction->setText(tr("Hide Sidebar"));
else
m_toggleSideBarAction->setText(tr("Show Sidebar"));
}
void NavigationWidget::placeHolderChanged(NavigationWidgetPlaceHolder *holder)
{
m_toggleSideBarAction->setEnabled(holder);
m_toggleSideBarAction->setChecked(holder && isShown());
updateToggleText();
}
void NavigationWidget::resizeEvent(QResizeEvent *re)
......@@ -307,6 +316,7 @@ void NavigationWidget::setShown(bool b)
} else {
m_toggleSideBarAction->setChecked(false);
}
updateToggleText();
}
bool NavigationWidget::isShown() const
......
......@@ -107,6 +107,7 @@ private slots:
void closeSubWidget();
private:
void updateToggleText();
NavigationSubWidget *insertSubItem(int position);
QList<NavigationSubWidget *> m_subWidgets;
QHash<QShortcut *, QString> m_shortcutMap;
......
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