forked from qt-creator/qt-creator
Help: Fix text of View > Show Left Sidebar check item
The text should never be "Hide Left Sidebar", because it is a checked item. Just set the tooltip, like done in coreplugin/navigationwidget.cpp Task-number: QTCREATORBUG-27733 Change-Id: I0cda56712724a69cb08411e62be57b88909416fe Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -229,9 +229,12 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
|
|||||||
m_toggleSideBarAction->setChecked(false);
|
m_toggleSideBarAction->setChecked(false);
|
||||||
cmd = Core::ActionManager::registerAction(m_toggleSideBarAction,
|
cmd = Core::ActionManager::registerAction(m_toggleSideBarAction,
|
||||||
Core::Constants::TOGGLE_LEFT_SIDEBAR, context);
|
Core::Constants::TOGGLE_LEFT_SIDEBAR, context);
|
||||||
connect(m_toggleSideBarAction, &QAction::toggled, m_toggleSideBarAction, [this](bool checked) {
|
connect(m_toggleSideBarAction,
|
||||||
m_toggleSideBarAction->setText(::Core::Tr::tr(
|
&QAction::toggled,
|
||||||
checked ? Core::Constants::TR_HIDE_LEFT_SIDEBAR
|
m_toggleSideBarAction,
|
||||||
|
[this](bool checked) {
|
||||||
|
m_toggleSideBarAction->setToolTip(
|
||||||
|
::Core::Tr::tr(checked ? Core::Constants::TR_HIDE_LEFT_SIDEBAR
|
||||||
: Core::Constants::TR_SHOW_LEFT_SIDEBAR));
|
: Core::Constants::TR_SHOW_LEFT_SIDEBAR));
|
||||||
});
|
});
|
||||||
addSideBar();
|
addSideBar();
|
||||||
|
|||||||
Reference in New Issue
Block a user