From d9959c1a7c7599fca844c99fe73d5ad9ee29c47c Mon Sep 17 00:00:00 2001 From: Udo Hoffmann Date: Sun, 23 Aug 2020 12:21:26 +0200 Subject: [PATCH] Enhance side panels behaviour: close a single panel instead of the entire stack Close #8471, close #8753 --- .../WinControls/DockingWnd/DockingCont.cpp | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index 929149c18..d8371960f 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -1136,33 +1136,25 @@ void DockingCont::onSize() void DockingCont::doClose() { - int iItemOff = 0; int iItemCnt = static_cast(::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(&tcItem)); + if (tcItem.lParam) { - TCITEM tcItem = {0}; - - // get item data - selectTab(iItemOff); - tcItem.mask = TCIF_PARAM; - ::SendMessage(_hContTab, TCM_GETITEM, iItemOff, reinterpret_cast(&tcItem)); - if (!tcItem.lParam) - continue; - // notify child windows if (NotifyParent(DMM_CLOSE) == 0) { // delete tab hideToolbar((tTbData*)tcItem.lParam); } - else - { - ++iItemOff; - } } - if (iItemOff == 0) + iItemCnt = static_cast(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0)); + if (iItemCnt == 0) { // hide dialog first this->doDialog(false);