UI: Asset Shelf (Experimental Feature) #104831
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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_);
|
||||
|
||||
|
|
Loading…
Reference in New Issue