Select the Editor when we click its tab (even when the tab is already selected)

With this change we generate an onSelectTab() when a tab is clicked
even when it's selected. This is useful to select the view related to
the tab when several selected tabs are visible at the same time.
This commit is contained in:
David Capello 2015-08-20 09:20:58 -03:00
parent 835fe40540
commit d706d0c8fa

View File

@ -376,7 +376,7 @@ bool Tabs::onProcessMessage(Message* msg)
invalidate();
}
}
else if (mouseMsg->left() && m_selected != m_hot) {
else if (mouseMsg->left()) {
selectTabInternal(m_hot);
}
@ -548,9 +548,11 @@ void Tabs::onPreferredSize(PreferredSizeEvent& ev)
void Tabs::selectTabInternal(TabPtr& tab)
{
m_selected = tab;
makeTabVisible(tab.get());
invalidate();
if (m_selected != tab) {
m_selected = tab;
makeTabVisible(tab.get());
invalidate();
}
if (m_delegate)
m_delegate->onSelectTab(this, tab->view);