UI: Asset Shelf (Experimental Feature) #104831

Closed
Julian Eisel wants to merge 399 commits from asset-shelf into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
6 changed files with 22 additions and 2 deletions
Showing only changes of commit ed2f8731f3 - Show all commits

View File

@ -85,6 +85,7 @@ class AssetCatalogSelectorTree : public ui::AbstractTreeView {
catalog_path_enabled_(
settings_is_catalog_path_enabled(shelf_settings, catalog_item.catalog_path()))
{
disable_activatable();
}
bool is_catalog_path_enabled() const

View File

@ -127,6 +127,7 @@ class AbstractViewItem {
* If this wasn't done, the behavior of items is undefined.
*/
AbstractView *view_ = nullptr;
bool is_activatable_ = true;
bool is_interactive_ = true;
bool is_active_ = false;
bool is_renaming_ = false;
@ -177,6 +178,7 @@ class AbstractViewItem {
void disable_interaction();
bool is_interactive() const;
void disable_activatable();
/**
* Requires the view to have completed reconstruction, see #is_reconstructed(). Otherwise we
* can't be sure about the item state.

View File

@ -11329,6 +11329,10 @@ static int ui_handle_menus_recursive(bContext *C,
}
}
if (!menu->retvalue) {
ui_handle_viewlist_items_hover(event, menu->region);
}
if (do_towards_reinit) {
ui_mouse_motion_towards_reinit(menu, event->xy);
}

View File

@ -209,6 +209,11 @@ void AbstractViewItem::disable_interaction()
is_interactive_ = false;
}
void AbstractViewItem::disable_activatable()
{
is_activatable_ = false;
}
bool AbstractViewItem::is_interactive() const
{
return is_interactive_;

View File

@ -158,6 +158,9 @@ void AbstractGridViewItem::activate()
BLI_assert_msg(get_view().is_reconstructed(),
"Item activation can't be done until reconstruction is completed");
if (!is_activatable_) {
return;
}
if (is_active()) {
return;
}

View File

@ -293,6 +293,9 @@ void AbstractTreeViewItem::activate()
BLI_assert_msg(get_tree_view().is_reconstructed(),
"Item activation can't be done until reconstruction is completed");
if (!is_activatable_) {
return;
}
if (is_active()) {
return;
}
@ -462,14 +465,16 @@ void TreeViewLayoutBuilder::build_row(AbstractTreeViewItem &item) const
uiLayoutSetActive(overlap, false);
}
uiLayoutRow(overlap, false);
uiLayout *row = uiLayoutRow(overlap, false);
/* Enable emboss for item mouse hover highlight. */
uiLayoutSetEmboss(row, UI_EMBOSS);
/* Every item gets one! Other buttons can be overlapped on top. */
item.add_treerow_button(block_);
/* After adding tree-row button (would disable hover highlighting). */
UI_block_emboss_set(&block_, UI_EMBOSS_NONE);
uiLayout *row = uiLayoutRow(overlap, true);
row = uiLayoutRow(overlap, true);
item.add_indent(*row);
item.add_collapse_chevron(block_);