Skip to content

Commit

Permalink
Fix favorite expand buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
oviradoi committed May 29, 2020
1 parent ecde9b9 commit 528bef3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Explorer/src/FavesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ void FavesDialog::InitialDialog(void)
/* add new items in list and make reference to items */
for (UINT i = 0; i < FAVES_ITEM_MAX; i++)
{
UpdateLink(InsertItem(cFavesItemNames[i], i, i, 0, 0, TVI_ROOT, TVI_LAST, TRUE, (LPARAM)&_vDB[i]));
UpdateLink(InsertItem(cFavesItemNames[i], i, i, 0, 0, TVI_ROOT, TVI_LAST, !_vDB[i].vElements.empty(), (LPARAM)&_vDB[i]));
}
}

Expand Down Expand Up @@ -697,7 +697,7 @@ void FavesDialog::PasteItem(HTREEITEM hItem)

/* update information and delete element */
UpdateLink(hParentItem);
UpdateNode(hParentItem, (BOOL)pParentElem->vElements.size());
UpdateNode(hParentItem, !pParentElem->vElements.empty());
ExpandElementsRecursive(hParentItem);
}
else
Expand Down Expand Up @@ -1525,6 +1525,9 @@ void FavesDialog::UpdateLink(HTREEITEM hParentItem)
hCurrentItem = TreeView_GetNextItem(_hTreeCtrl, hCurrentItem, TVGN_NEXT);
}

// Update current node
UpdateNode(hParentItem, !parentElement->vElements.empty());

/* delete possible not existed items */
while (hCurrentItem != NULL)
{
Expand Down

0 comments on commit 528bef3

Please sign in to comment.