From a654dc0b3a88bb9e023090f898e82ed6bdacd342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Tue, 20 Jan 2009 15:38:51 +0100 Subject: [PATCH] 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. --- src/plugins/coreplugin/mainwindow.cpp | 10 +++++----- src/plugins/coreplugin/mainwindow.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 5742eb1a125..1c83700a1d6 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -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); diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index c7fccdefabb..e1fb1d9c662 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -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: -- GitLab