mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-01 11:04:40 +02:00
Enhance side panels behaviour: close a single panel instead of the entire stack
Close #8471, close #8753
This commit is contained in:
parent
00d75495c9
commit
d9959c1a7c
@ -1136,33 +1136,25 @@ void DockingCont::onSize()
|
|||||||
|
|
||||||
void DockingCont::doClose()
|
void DockingCont::doClose()
|
||||||
{
|
{
|
||||||
int iItemOff = 0;
|
|
||||||
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
||||||
|
int iItemCur = getActiveTb();
|
||||||
|
|
||||||
for (int iItem = 0; iItem < iItemCnt; ++iItem)
|
TCITEM tcItem = {0};
|
||||||
|
|
||||||
|
tcItem.mask = TCIF_PARAM;
|
||||||
|
::SendMessage(_hContTab, TCM_GETITEM, iItemCur, reinterpret_cast<LPARAM>(&tcItem));
|
||||||
|
if (tcItem.lParam)
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
|
||||||
|
|
||||||
// get item data
|
|
||||||
selectTab(iItemOff);
|
|
||||||
tcItem.mask = TCIF_PARAM;
|
|
||||||
::SendMessage(_hContTab, TCM_GETITEM, iItemOff, reinterpret_cast<LPARAM>(&tcItem));
|
|
||||||
if (!tcItem.lParam)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// notify child windows
|
// notify child windows
|
||||||
if (NotifyParent(DMM_CLOSE) == 0)
|
if (NotifyParent(DMM_CLOSE) == 0)
|
||||||
{
|
{
|
||||||
// delete tab
|
// delete tab
|
||||||
hideToolbar((tTbData*)tcItem.lParam);
|
hideToolbar((tTbData*)tcItem.lParam);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
++iItemOff;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iItemOff == 0)
|
iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
||||||
|
if (iItemCnt == 0)
|
||||||
{
|
{
|
||||||
// hide dialog first
|
// hide dialog first
|
||||||
this->doDialog(false);
|
this->doDialog(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user