Browse Source

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
commit
8afa4c6ea8
  1. 9
      PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp
  2. 2
      PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h

9
PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp

@ -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,7 +360,9 @@ void VerticalFileSwitcherListView::remove(int index)
ListView_GetItem(_hSelf, &item);
TaskLstFnStatus *tlfs = (TaskLstFnStatus *)item.lParam;
delete tlfs;
ListView_DeleteItem(_hSelf, index);
if (del)
ListView_DeleteItem(_hSelf, index);
}
void VerticalFileSwitcherListView::removeAll()
@ -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));

2
PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h

@ -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