mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 12:39:57 +00:00
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:
parent
835fe40540
commit
d706d0c8fa
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user