Skip to content

Commit

Permalink
Fix regression of multi-line tabbar height not updated after closing
Browse files Browse the repository at this point in the history
Fix regression of multi-line tabbar height not updated after "Close all to the Right" command.

Fix notepad-plus-plus#15905, close notepad-plus-plus#15906
  • Loading branch information
donho committed Dec 4, 2024
1 parent ec0b2b5 commit 11a02f6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6699,7 +6699,7 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
if (mask & (BufferChangeDirty|BufferChangeFilename))
{
if (mask & BufferChangeFilename)
::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REFRESHTABAR, 0, 0);
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);

checkDocState();
setTitle();
Expand Down
9 changes: 1 addition & 8 deletions PowerEditor/src/NppBigSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3894,13 +3894,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
}
break;

case NPPM_INTERNAL_REFRESHTABAR:
{
::InvalidateRect(_mainDocTab.getHSelf(), NULL, TRUE);
::InvalidateRect(_subDocTab.getHSelf(), NULL, TRUE);

break;
}
case NPPM_INTERNAL_LOCKTABBAR:
{
bool isDrag = TabBarPlus::doDragNDropOrNot();
Expand Down Expand Up @@ -3960,7 +3953,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
::SendMessage(_subDocTab.getHSelf(), WM_SETFONT, reinterpret_cast<WPARAM>(hf), MAKELPARAM(TRUE, 0));
}

::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REFRESHTABAR, 0, 0);
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);

_mainDocTab.refresh();
_subDocTab.refresh();
Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/NppCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3991,7 +3991,7 @@ void Notepad_plus::command(int id)
nmhdr._hdr.idFrom = reinterpret_cast<UINT_PTR>(this);
nmhdr._tabOrigin = _pDocTab->getCurrentTabIndex();
::SendMessage(_pPublicInterface->getHSelf(), WM_NOTIFY, 0, reinterpret_cast<LPARAM>(&nmhdr));
::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REFRESHTABAR, 0, 0);
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
}
break;

Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/NppIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup)
if (buffID == BUFFER_INVALID && fileFullPath.length() > 0)
_lastRecentFileList.add(fileFullPath.c_str());
}
::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REFRESHTABAR, 0, 0);
::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);

if (NppParameters::getInstance().getNppGUI()._tabStatus & TAB_QUITONEMPTY)
{
Expand Down
4 changes: 2 additions & 2 deletions PowerEditor/src/WinControls/TabBar/TabBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
if (_closeButtonZone.isHit(xPos, yPos, _currentHoverTabRect, _isVertical))
{
_whichCloseClickDown = getTabIndexAt(xPos, yPos);
::SendMessage(_hParent, NPPM_INTERNAL_REFRESHTABAR, 0, 0);
::SendMessage(_hParent, WM_SIZE, 0, 0);
return TRUE;
}
}
Expand All @@ -802,7 +802,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
if (_pinButtonZone.isHit(xPos, yPos, _currentHoverTabRect, _isVertical))
{
_whichPinClickDown = getTabIndexAt(xPos, yPos);
::SendMessage(_hParent, NPPM_INTERNAL_REFRESHTABAR, 0, 0);
::SendMessage(_hParent, WM_SIZE, 0, 0);
return TRUE;
}
}
Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@
#define NPPM_INTERNAL_DOCMODIFIEDBYREPLACEALL (NOTEPADPLUS_USER_INTERNAL + 79)
#define NPPM_INTERNAL_DRAWTABBARPINBUTTON (NOTEPADPLUS_USER_INTERNAL + 80)
#define NPPM_INTERNAL_DRAWTABBARCLOSEBUTTON (NOTEPADPLUS_USER_INTERNAL + 81)
#define NPPM_INTERNAL_REFRESHTABAR (NOTEPADPLUS_USER_INTERNAL + 82)
//#define NPPM_INTERNAL_REFRESHTABAR (NOTEPADPLUS_USER_INTERNAL + 82)
#define NPPM_INTERNAL_REDUCETABBAR (NOTEPADPLUS_USER_INTERNAL + 83)
#define NPPM_INTERNAL_LOCKTABBAR (NOTEPADPLUS_USER_INTERNAL + 84)
#define NPPM_INTERNAL_DRAWINACIVETAB (NOTEPADPLUS_USER_INTERNAL + 85)
Expand Down

0 comments on commit 11a02f6

Please sign in to comment.