forked from qt-creator/qt-creator
Fix state of side bar buttons when switching different design widgets
When switching between different editors in Design mode (e.g. ui and qml), the side bar buttons must update. So far they reacted on mode switches, but not on changes of the main window while staying in the same mode. Change-Id: I85635f12bb8613e90ec81056d8763431c04fea2e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -190,6 +190,7 @@ Utils::FancyMainWindow *IMode::mainWindow()
|
|||||||
void IMode::setMainWindow(Utils::FancyMainWindow *mw)
|
void IMode::setMainWindow(Utils::FancyMainWindow *mw)
|
||||||
{
|
{
|
||||||
m_d->m_mainWindow = mw;
|
m_d->m_mainWindow = mw;
|
||||||
|
emit ModeManager::instance()->currentMainWindowChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IMode::isEnabled() const
|
bool IMode::isEnabled() const
|
||||||
|
|||||||
@@ -322,6 +322,7 @@ void ModeManager::currentTabChanged(int index)
|
|||||||
oldMode = d->m_modes.at(d->m_oldCurrent);
|
oldMode = d->m_modes.at(d->m_oldCurrent);
|
||||||
d->m_oldCurrent = index;
|
d->m_oldCurrent = index;
|
||||||
emit currentModeChanged(mode->id(), oldMode ? oldMode->id() : Id());
|
emit currentModeChanged(mode->id(), oldMode ? oldMode->id() : Id());
|
||||||
|
emit currentMainWindowChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ signals:
|
|||||||
// the default argument '=0' is important for connects without the oldMode argument.
|
// the default argument '=0' is important for connects without the oldMode argument.
|
||||||
void currentModeChanged(Utils::Id mode, Utils::Id oldMode = {});
|
void currentModeChanged(Utils::Id mode, Utils::Id oldMode = {});
|
||||||
|
|
||||||
|
void currentMainWindowChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit ModeManager(Internal::FancyTabWidget *modeStack);
|
explicit ModeManager(Internal::FancyTabWidget *modeStack);
|
||||||
~ModeManager() override;
|
~ModeManager() override;
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ NavigationWidget::NavigationWidget(QAction *toggleSideBarAction, Side side) :
|
|||||||
NavigationWidgetPrivate::s_instanceRight = this;
|
NavigationWidgetPrivate::s_instanceRight = this;
|
||||||
|
|
||||||
connect(ModeManager::instance(),
|
connect(ModeManager::instance(),
|
||||||
&ModeManager::currentModeChanged,
|
&ModeManager::currentMainWindowChanged,
|
||||||
this,
|
this,
|
||||||
&NavigationWidget::updateMode);
|
&NavigationWidget::updateMode);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user