forked from qt-creator/qt-creator
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.
This commit is contained in:
@@ -203,14 +203,14 @@ MainWindow::MainWindow() :
|
|||||||
statusBar()->setProperty("p_styled", true);
|
statusBar()->setProperty("p_styled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::toggleNavigation()
|
void MainWindow::setSidebarVisible(bool visible)
|
||||||
{
|
{
|
||||||
if (NavigationWidgetPlaceHolder::current()) {
|
if (NavigationWidgetPlaceHolder::current()) {
|
||||||
if (m_navigationWidget->isSuppressed()) {
|
if (m_navigationWidget->isSuppressed() && visible) {
|
||||||
m_navigationWidget->setShown(true);
|
m_navigationWidget->setShown(true);
|
||||||
m_navigationWidget->setSuppressed(false);
|
m_navigationWidget->setSuppressed(false);
|
||||||
} else {
|
} else {
|
||||||
m_navigationWidget->setShown(!m_navigationWidget->isShown());
|
m_navigationWidget->setShown(visible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -628,7 +628,7 @@ void MainWindow::registerDefaultActions()
|
|||||||
|
|
||||||
// Toggle Sidebar Action
|
// Toggle Sidebar Action
|
||||||
m_toggleSideBarAction = new QAction(QIcon(Constants::ICON_TOGGLE_SIDEBAR),
|
m_toggleSideBarAction = new QAction(QIcon(Constants::ICON_TOGGLE_SIDEBAR),
|
||||||
tr("Toggle Sidebar"), this);
|
tr("Show Sidebar"), this);
|
||||||
m_toggleSideBarAction->setCheckable(true);
|
m_toggleSideBarAction->setCheckable(true);
|
||||||
cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, m_globalContext);
|
cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, m_globalContext);
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@@ -636,7 +636,7 @@ void MainWindow::registerDefaultActions()
|
|||||||
#else
|
#else
|
||||||
cmd->setDefaultKeySequence(QKeySequence("Alt+0"));
|
cmd->setDefaultKeySequence(QKeySequence("Alt+0"));
|
||||||
#endif
|
#endif
|
||||||
connect(m_toggleSideBarAction, SIGNAL(triggered()), this, SLOT(toggleNavigation()));
|
connect(m_toggleSideBarAction, SIGNAL(triggered(bool)), this, SLOT(setSidebarVisible(bool)));
|
||||||
m_toggleSideBarButton->setDefaultAction(cmd->action());
|
m_toggleSideBarButton->setDefaultAction(cmd->action());
|
||||||
mwindow->addAction(cmd, Constants::G_WINDOW_PANES);
|
mwindow->addAction(cmd, Constants::G_WINDOW_PANES);
|
||||||
m_toggleSideBarAction->setEnabled(false);
|
m_toggleSideBarAction->setEnabled(false);
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ private slots:
|
|||||||
void aboutQtCreator();
|
void aboutQtCreator();
|
||||||
void aboutPlugins();
|
void aboutPlugins();
|
||||||
void updateFocusWidget(QWidget *old, QWidget *now);
|
void updateFocusWidget(QWidget *old, QWidget *now);
|
||||||
void toggleNavigation();
|
void setSidebarVisible(bool visible);
|
||||||
void destroyVersionDialog();
|
void destroyVersionDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user