diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 45a54eee..ea96a90a 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -2953,15 +2953,12 @@ void Notepad_plus::command(int id) //Resize the tab height int tabHeight = _toReduceTabBar?20:25; + TabCtrl_SetItemSize(_mainDocTab.getHSelf(), 45, tabHeight); + TabCtrl_SetItemSize(_subDocTab.getHSelf(), 45, tabHeight); + _docTabIconList.setIconSize(iconSize); //change the font int stockedFont = _toReduceTabBar?DEFAULT_GUI_FONT:SYSTEM_FONT; - - TabCtrl_SetItemSize(_mainDocTab.getHSelf(), 45, tabHeight); - TabCtrl_SetItemSize(_subDocTab.getHSelf(), 45, tabHeight); - - _docTabIconList.setIconSize(iconSize); - HFONT hf = (HFONT)::GetStockObject(stockedFont); if (hf) @@ -2977,6 +2974,8 @@ void Notepad_plus::command(int id) break; } + + case IDM_VIEW_REFRESHTABAR : { RECT rc; @@ -6905,6 +6904,11 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa updateStatusBar(); return TRUE; } + + case NPPM_INTERNAL_ISTABBARREDUCED : + { + return _toReduceTabBar?TRUE:FALSE; + } // ADD: success->hwnd; failure->NULL // REMOVE: success->NULL; failure->hwnd @@ -7228,11 +7232,11 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa case NPPM_HIDETABBAR : { bool hide = (lParam != 0); - bool oldVal = _mainDocTab.setHideTabBarStatus(205); + bool oldVal = _mainDocTab.setHideTabBarStatus(hide); _subDocTab.setHideTabBarStatus(hide); ::SendMessage(_hSelf, WM_SIZE, 0, 0); - ::ShowWindow(_mainDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW); - ::ShowWindow(_subDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW); + //::ShowWindow(_mainDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW); + //::ShowWindow(_subDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW); return oldVal; } diff --git a/PowerEditor/src/ScitillaComponent/DocTabView.cpp b/PowerEditor/src/ScitillaComponent/DocTabView.cpp index 70114dee..ee20b1e9 100644 --- a/PowerEditor/src/ScitillaComponent/DocTabView.cpp +++ b/PowerEditor/src/ScitillaComponent/DocTabView.cpp @@ -89,10 +89,6 @@ char * DocTabView::activate(int index) { TabBar::activateAt(index); return _pView->activateDocAt(index); - - //char *title = _pView->activateDocAt(index); - //_pView->execute(SCI_SETLEXER, SCLEX_CONTAINER); - //return title; } // this method updates the doc when user clicks a sub tab @@ -145,7 +141,6 @@ void DocTabView::closeDocAt(int index2Close) void DocTabView::updateCurrentTabItem(const char *title) { - //char str[32]; int currentIndex = TabCtrl_GetCurSel(_hSelf); updateTabItem(currentIndex, title); diff --git a/PowerEditor/src/ScitillaComponent/DocTabView.h b/PowerEditor/src/ScitillaComponent/DocTabView.h index 24f6b14f..013c0b76 100644 --- a/PowerEditor/src/ScitillaComponent/DocTabView.h +++ b/PowerEditor/src/ScitillaComponent/DocTabView.h @@ -76,6 +76,7 @@ public : virtual void reSizeTo(RECT & rc) { if (!_hideTabBarStatus) { + //::ShowWindow(getHSelf(), SW_SHOW); TabBar::reSizeTo(rc); //rc.top += 2; //rc.right -= 4; diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp index 12d86495..b251935e 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp @@ -179,6 +179,7 @@ LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam) _pWin0->reSizeTo(rc0); _pWin1->reSizeTo(rc1); + ::InvalidateRect(_splitter.getHSelf(), NULL, TRUE); return TRUE; } diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h index 6adccde7..07f7f54d 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h @@ -56,9 +56,10 @@ public : }; virtual void display(bool toShow = true) const { Window::display(toShow); - _splitter.display(toShow); + _pWin0->display(toShow); _pWin1->display(toShow); + _splitter.display(toShow); }; virtual void redraw() const { _pWin0->redraw(); diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index b75e20ec..9421c3c6 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -230,18 +230,23 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad } LOGFONT LogFont; - + _hFont = (HFONT)::SendMessage(_hSelf, WM_GETFONT, 0, 0); if (_hFont == NULL) - _hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); - + _hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); + + if (_hLargeFont == NULL) + _hLargeFont = (HFONT)::GetStockObject(SYSTEM_FONT); + if (::GetObject(_hFont, sizeof(LOGFONT), &LogFont) != 0) { LogFont.lfEscapement = 900; LogFont.lfOrientation = 900; + _hVerticalFont = CreateFontIndirect(&LogFont); - _hVerticalFont = CreateFontIndirect(&LogFont); + LogFont.lfWeight = 900; + _hVerticalLargeFont = CreateFontIndirect(&LogFont); } } @@ -615,11 +620,23 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct) } } - //if (_isVertical) - //SelectObject(hDC, _hVerticalFont); - //else - //SelectObject(hDC, _hFont); - + bool isStandardSize = (::SendMessage(_hParent, NPPM_INTERNAL_ISTABBARREDUCED, 0, 0) == TRUE); + + if (isStandardSize) + { + if (_isVertical) + SelectObject(hDC, _hVerticalFont); + else + SelectObject(hDC, _hFont); + } + else + { + if (_isVertical) + SelectObject(hDC, _hVerticalLargeFont); + else + SelectObject(hDC, _hLargeFont); + } + int Flags = DT_SINGLELINE; if (_drawTabCloseButton) diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.h b/PowerEditor/src/WinControls/TabBar/TabBar.h index 81568273..2c17200a 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.h +++ b/PowerEditor/src/WinControls/TabBar/TabBar.h @@ -49,19 +49,17 @@ public: if (_hFont) DeleteObject(_hFont); + if (_hLargeFont) + DeleteObject(_hLargeFont); + if (_hVerticalFont) DeleteObject(_hVerticalFont); + if (_hVerticalLargeFont) + DeleteObject(_hVerticalLargeFont); + ::DestroyWindow(_hSelf); _hSelf = NULL; - - /* - if ((!_isTraditional) && (_ctrlID != -1)) - { - _hwndArray[_ctrlID] = NULL; - _nbCtrl--; - } - */ }; virtual void init(HINSTANCE hInst, HWND hwnd, bool isVertical = false, bool isTraditional = false, bool isMultiLine = false); @@ -125,7 +123,9 @@ protected: size_t _nbItem; bool _hasImgLst; HFONT _hFont; + HFONT _hLargeFont; HFONT _hVerticalFont; + HFONT _hVerticalLargeFont; int _ctrlID; bool _isTraditional; diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index 73ecdf87..831162b0 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -147,6 +147,7 @@ #define IDM_VIEW_HIDELINES (IDM_VIEW + 42) #define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) #define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) + //#define (IDM_VIEW + 45) #define IDM_VIEW_FOLD (IDM_VIEW + 50) #define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1) diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index 5b1a4575..e959a3ad 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -282,6 +282,7 @@ #define NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE (NOTEPADPLUS_USER_INTERNAL + 9) #define NPPM_INTERNAL_DOCSWITCHOFF (NOTEPADPLUS_USER_INTERNAL + 10) #define NPPM_INTERNAL_DOCSWITCHIN (NOTEPADPLUS_USER_INTERNAL + 11) + #define NPPM_INTERNAL_ISTABBARREDUCED (NOTEPADPLUS_USER_INTERNAL + 12) // See Notepad_plus_msgs.h //#define NOTEPADPLUS_USER (WM_USER + 1000) #define SCINTILLA_USER (WM_USER + 2000)