Fix dragging tab performance issue while Document List is displayed

Fix #13479, fix #12632, close #14080
pull/14101/head
Orden4 1 year ago committed by Don Ho
parent 14d8aaaa1f
commit 8afa4c6ea8

@ -352,7 +352,7 @@ int VerticalFileSwitcherListView::add(BufferID bufferID, int iView)
}
void VerticalFileSwitcherListView::remove(int index)
void VerticalFileSwitcherListView::remove(int index, bool del)
{
LVITEM item{};
item.mask = LVIF_PARAM;
@ -360,6 +360,8 @@ void VerticalFileSwitcherListView::remove(int index)
ListView_GetItem(_hSelf, &item);
TaskLstFnStatus *tlfs = (TaskLstFnStatus *)item.lParam;
delete tlfs;
if (del)
ListView_DeleteItem(_hSelf, index);
}
@ -369,8 +371,9 @@ void VerticalFileSwitcherListView::removeAll()
for (int i = nbItem - 1; i >= 0 ; --i)
{
remove(i);
remove(i, false);
}
ListView_DeleteAllItems(_hSelf);
HWND colHeader = reinterpret_cast<HWND>(SendMessage(_hSelf, LVM_GETHEADER, 0, 0));
int columnCount = static_cast<int32_t>(SendMessage(colHeader, HDM_GETITEMCOUNT, 0, 0));

@ -88,7 +88,7 @@ protected:
int find(BufferID bufferID, int iView) const;
int add(BufferID bufferID, int iView);
void remove(int index);
void remove(int index, bool del = true);
void removeAll();
void selectCurrentItem() const {
ListView_SetItemState(_hSelf, _currentIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);

Loading…
Cancel
Save