From 9faa97a6f95bb0dac7f64fc86e207bddb0b0d9b6 Mon Sep 17 00:00:00 2001 From: Don HO Date: Thu, 23 Feb 2017 23:58:57 +0100 Subject: [PATCH] Fix a regression of hidden status bar due to the enhancement of tab interface --- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index ceed21f1..f07a7eba 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -241,27 +241,24 @@ void TabBar::reSizeTo(RECT & rc2Ajust) } else //if (_isMultiLine) { + LONG_PTR style = ::GetWindowLongPtr(_hSelf, GWL_STYLE); + int marge = 0; if (rowCount == 1) { - LONG_PTR style = ::GetWindowLongPtr(_hSelf, GWL_STYLE); style &= ~TCS_BUTTONS; - ::SetWindowLongPtr(_hSelf, GWL_STYLE, style); - - TabCtrl_AdjustRect(_hSelf, FALSE, &rc2Ajust); } else // (rowCount >= 2) { - LONG_PTR style = ::GetWindowLongPtr(_hSelf, GWL_STYLE); style |= TCS_BUTTONS; - ::SetWindowLongPtr(_hSelf, GWL_STYLE, style); - - 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; + marge = 3; // in TCS_BUTTONS mode, each row has few pixels higher } + + ::SetWindowLongPtr(_hSelf, GWL_STYLE, style); + tabsHight = rowCount * (rowRect.bottom - rowRect.top + marge); + tabsHight += GetSystemMetrics(SM_CYEDGE); + + rc2Ajust.top += tabsHight; + rc2Ajust.bottom -= tabsHight; } }