Asset Browser: Show catalog add & delete icons on mouse hover (only)
Now the icons to add or delete catalogs are only shown when mouse hovering a catalog item in the tree. This is convenient for quick creation of catalogs, and doesn't require activating a catalog to edit it first. Determining if a tree item is hovered isn't trivial actually. The UI tree-view code has to find the matching tree-row button in the previous layout to do so, since the new layout isn't calculated yet.
This commit is contained in:
@@ -185,6 +185,7 @@ class AbstractTreeView : public TreeViewItemContainer {
|
||||
const TreeViewItemContainer &old_items);
|
||||
static AbstractTreeViewItem *find_matching_child(const AbstractTreeViewItem &lookup_item,
|
||||
const TreeViewItemContainer &items);
|
||||
|
||||
/**
|
||||
* Items may want to do additional work when state changes. But these state changes can only be
|
||||
* reliably detected after the tree has completed reconstruction (see #is_reconstructed()). So
|
||||
@@ -290,6 +291,12 @@ class AbstractTreeViewItem : public TreeViewItemContainer {
|
||||
* can't be sure about the item state.
|
||||
*/
|
||||
bool is_active() const;
|
||||
/**
|
||||
* Can be called from the #AbstractTreeViewItem::build_row() implementation, but not earlier. The
|
||||
* hovered state can't be queried reliably otherwise.
|
||||
* Note that this does a linear lookup in the old block, so isn't too great performance-wise.
|
||||
*/
|
||||
bool is_hovered() const;
|
||||
void toggle_collapsed();
|
||||
/**
|
||||
* Requires the tree to have completed reconstruction, see #is_reconstructed(). Otherwise we
|
||||
|
||||
Reference in New Issue
Block a user