Commit a654dc0b authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Renamed 'Toggle Sidebar' to 'Show Sidebar'

Since it's checkable now, "Show Sidebar" is more suitable. Also changed
the interface a bit to allow more than just toggling.
parent 897c05f5
......@@ -203,14 +203,14 @@ MainWindow::MainWindow() :
statusBar()->setProperty("p_styled", true);
}
void MainWindow::toggleNavigation()
void MainWindow::setSidebarVisible(bool visible)
{
if (NavigationWidgetPlaceHolder::current()) {
if (m_navigationWidget->isSuppressed()) {
if (m_navigationWidget->isSuppressed() && visible) {
m_navigationWidget->setShown(true);
m_navigationWidget->setSuppressed(false);
} else {
m_navigationWidget->setShown(!m_navigationWidget->isShown());
m_navigationWidget->setShown(visible);
}
}
}
......@@ -628,7 +628,7 @@ void MainWindow::registerDefaultActions()
// Toggle Sidebar Action
m_toggleSideBarAction = new QAction(QIcon(Constants::ICON_TOGGLE_SIDEBAR),
tr("Toggle Sidebar"), this);
tr("Show Sidebar"), this);
m_toggleSideBarAction->setCheckable(true);
cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, m_globalContext);
#ifdef Q_OS_MAC
......@@ -636,7 +636,7 @@ void MainWindow::registerDefaultActions()
#else
cmd->setDefaultKeySequence(QKeySequence("Alt+0"));
#endif
connect(m_toggleSideBarAction, SIGNAL(triggered()), this, SLOT(toggleNavigation()));
connect(m_toggleSideBarAction, SIGNAL(triggered(bool)), this, SLOT(setSidebarVisible(bool)));
m_toggleSideBarButton->setDefaultAction(cmd->action());
mwindow->addAction(cmd, Constants::G_WINDOW_PANES);
m_toggleSideBarAction->setEnabled(false);
......
......@@ -158,7 +158,7 @@ private slots:
void aboutQtCreator();
void aboutPlugins();
void updateFocusWidget(QWidget *old, QWidget *now);
void toggleNavigation();
void setSidebarVisible(bool visible);
void destroyVersionDialog();
private:
......
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