Fix multi-line tab button stay pushed issue while swiching off.
Make sure previous tab does not keep focus when switching tabs. TO REPRODUCE: Step 1: Move a tab using drag and drop. Step 2: Use a tab switching hotkey/feature which doesn't set TCM_SETCURFOCUS AND TCM_SETCURSEL Fixes #3545, closes #3552
This commit is contained in:
parent
194376d6d7
commit
8342da3df8
@ -152,7 +152,15 @@ void TabBar::setFont(TCHAR *fontName, int fontSize)
|
|||||||
void TabBar::activateAt(int index) const
|
void TabBar::activateAt(int index) const
|
||||||
{
|
{
|
||||||
if (getCurrentTabIndex() != index)
|
if (getCurrentTabIndex() != index)
|
||||||
|
{
|
||||||
|
// TCS_BUTTONS needs both set or two tabs can appear selected
|
||||||
|
if (::GetWindowLongPtr(_hSelf, GWL_STYLE) & TCS_BUTTONS)
|
||||||
|
{
|
||||||
|
::SendMessage(_hSelf, TCM_SETCURFOCUS, index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
::SendMessage(_hSelf, TCM_SETCURSEL, index, 0);
|
::SendMessage(_hSelf, TCM_SETCURSEL, index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
TBHDR nmhdr;
|
TBHDR nmhdr;
|
||||||
nmhdr._hdr.hwndFrom = _hSelf;
|
nmhdr._hdr.hwndFrom = _hSelf;
|
||||||
|
Loading…
Reference in New Issue
Block a user