Fix a regression of hidden status bar due to the enhancement of tab interface

pull/2951/head
Don HO 2017-02-23 23:58:57 +01:00
parent a482cbd215
commit 9faa97a6f9
1 changed files with 10 additions and 13 deletions

View File

@ -241,27 +241,24 @@ void TabBar::reSizeTo(RECT & rc2Ajust)
} }
else //if (_isMultiLine) else //if (_isMultiLine)
{ {
LONG_PTR style = ::GetWindowLongPtr(_hSelf, GWL_STYLE);
int marge = 0;
if (rowCount == 1) if (rowCount == 1)
{ {
LONG_PTR style = ::GetWindowLongPtr(_hSelf, GWL_STYLE);
style &= ~TCS_BUTTONS; style &= ~TCS_BUTTONS;
::SetWindowLongPtr(_hSelf, GWL_STYLE, style);
TabCtrl_AdjustRect(_hSelf, FALSE, &rc2Ajust);
} }
else // (rowCount >= 2) else // (rowCount >= 2)
{ {
LONG_PTR style = ::GetWindowLongPtr(_hSelf, GWL_STYLE);
style |= TCS_BUTTONS; style |= TCS_BUTTONS;
::SetWindowLongPtr(_hSelf, GWL_STYLE, style); marge = 3; // in TCS_BUTTONS mode, each row has few pixels higher
const int marge = 3; // in TCS_BUTTONS mode, each row has few pixels higher
tabsHight = rowCount * (rowRect.bottom - rowRect.top + marge);
tabsHight += GetSystemMetrics(SM_CYEDGE);
rc2Ajust.top += tabsHight;
rc2Ajust.bottom -= tabsHight;
} }
::SetWindowLongPtr(_hSelf, GWL_STYLE, style);
tabsHight = rowCount * (rowRect.bottom - rowRect.top + marge);
tabsHight += GetSystemMetrics(SM_CYEDGE);
rc2Ajust.top += tabsHight;
rc2Ajust.bottom -= tabsHight;
} }
} }