diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 390d241bb..5fd588933 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4524,9 +4524,9 @@ int Notepad_plus::switchEditViewTo(int gid) //checkDocState(); setTitleWith(_pEditView->getCurrentTitle()); - //setLangStatus(_pEditView->getCurrentDocType()); - //updateStatusBar(); - //dynamicCheckMenuAndTB(); + + ::InvalidateRect(_mainDocTab.getHSelf(), NULL, TRUE); + ::InvalidateRect(_subDocTab.getHSelf(), NULL, TRUE); ::SendMessage(_hSelf, NPPM_INTERNAL_DOCSWITCHIN, 0, 0); return oldView; } @@ -7250,6 +7250,13 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa { return _mainDocTab.getHideTabBarStatus(); } + + case NPPM_INTERNAL_ISFOCUSEDTAB : + { + ScintillaEditView *cv = getCurrentEditView(); + HWND pMainTB = (_mainDocTab.getView() == cv)?_mainDocTab.getHSelf():_subDocTab.getHSelf(); + return (HWND)lParam == pMainTB; + } default: { diff --git a/PowerEditor/src/ScitillaComponent/DocTabView.cpp b/PowerEditor/src/ScitillaComponent/DocTabView.cpp index ee20b1e9b..e1c6fb650 100644 --- a/PowerEditor/src/ScitillaComponent/DocTabView.cpp +++ b/PowerEditor/src/ScitillaComponent/DocTabView.cpp @@ -41,7 +41,6 @@ char * DocTabView::newDocInit() // create a new (the first) sub tab then hightlight it TabBar::insertAtEnd(newTitle); - return newTitle; } @@ -64,10 +63,13 @@ const char * DocTabView::newDoc(const char *fn) if (fn[i] == '\0') break; } - //fnConformToTab[j] = '\0'; - TabBar::insertAtEnd(fnConformToTab); TabBar::activateAt(_nbItem - 1); + + if (_isMultiLine) + { + ::SendMessage(_hParent, WM_SIZE, 0, 0); + } return (const char *)completName; } @@ -80,6 +82,11 @@ const char * DocTabView::newDoc(Buffer & buf) // for the title of sub tab TabBar::insertAtEnd(PathFindFileName(completName)); TabBar::activateAt(_nbItem - 1); + + if (_isMultiLine) + { + ::SendMessage(_hParent, WM_SIZE, 0, 0); + } return completName; } @@ -121,6 +128,12 @@ const char * DocTabView::closeCurrentDoc() TabBar::activateAt(i2activate); } + + if (_isMultiLine) + { + ::SendMessage(_hParent, WM_SIZE, 0, 0); + } + return _pView->getCurrentTitle(); } diff --git a/PowerEditor/src/ScitillaComponent/DocTabView.h b/PowerEditor/src/ScitillaComponent/DocTabView.h index b90ed7aed..fdd5607b0 100644 --- a/PowerEditor/src/ScitillaComponent/DocTabView.h +++ b/PowerEditor/src/ScitillaComponent/DocTabView.h @@ -87,6 +87,10 @@ public : _pView->reSizeTo(rc); } }; + + const ScintillaEditView * getView() const { + return _pView; + }; private : static unsigned short _nbNewTitle; diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 9421c3c6f..28ee1b78b 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -515,7 +515,11 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct) rect.top += 2; } - hBrush = ::CreateSolidBrush(RGB(250, 170, 60)); + if (::SendMessage(_hParent, NPPM_INTERNAL_ISFOCUSEDTAB, 0, (LPARAM)_hSelf)) + hBrush = ::CreateSolidBrush(RGB(250, 170, 60)); // #FAAA3C + else + hBrush = ::CreateSolidBrush(RGB(250, 210, 150)); // #FAD296 + ::FillRect(hDC, &barRect, hBrush); ::DeleteObject((HGDIOBJ)hBrush); } diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index e959a3ad5..69f28b12e 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -283,6 +283,7 @@ #define NPPM_INTERNAL_DOCSWITCHOFF (NOTEPADPLUS_USER_INTERNAL + 10) #define NPPM_INTERNAL_DOCSWITCHIN (NOTEPADPLUS_USER_INTERNAL + 11) #define NPPM_INTERNAL_ISTABBARREDUCED (NOTEPADPLUS_USER_INTERNAL + 12) + #define NPPM_INTERNAL_ISFOCUSEDTAB (NOTEPADPLUS_USER_INTERNAL + 13) // See Notepad_plus_msgs.h //#define NOTEPADPLUS_USER (WM_USER + 1000) #define SCINTILLA_USER (WM_USER + 2000)