Fix #112985: Outliner header context menu shows asset operators

The Outliner exposed its context to the header as well which makes some
operators available there. While technically this is all fine, it's a
bit odd to the user, since they don't expect data-editing operations
when right clicking on a header that itself doesn't list data. Instead
only expose the Outliner context in the main region.
This commit is contained in:
Julian Eisel
2023-09-28 16:16:04 +02:00
parent 66056fead0
commit b82f3e90ca
3 changed files with 7 additions and 5 deletions

View File

@@ -35,9 +35,9 @@ static const char *outliner_context_dir[] = {
nullptr,
};
int /*eContextResult*/ outliner_context(const bContext *C,
const char *member,
bContextDataResult *result)
int /*eContextResult*/ outliner_main_region_context(const bContext *C,
const char *member,
bContextDataResult *result)
{
SpaceOutliner *space_outliner = CTX_wm_space_outliner(C);

View File

@@ -674,7 +674,9 @@ void outliner_sync_selection(const bContext *C, SpaceOutliner *space_outliner);
/* `outliner_context.cc` */
int outliner_context(const bContext *C, const char *member, bContextDataResult *result);
int outliner_main_region_context(const bContext *C,
const char *member,
bContextDataResult *result);
/**
* Helper to safely "cast" a #TreeElement to its new C++ #AbstractTreeElement, if possible.

View File

@@ -618,7 +618,6 @@ void ED_spacetype_outliner()
st->id_remap = outliner_id_remap;
st->foreach_id = outliner_foreach_id;
st->deactivate = outliner_deactivate;
st->context = outliner_context;
st->blend_read_data = outliner_space_blend_read_data;
st->blend_read_after_liblink = outliner_space_blend_read_after_liblink;
st->blend_write = outliner_space_blend_write;
@@ -633,6 +632,7 @@ void ED_spacetype_outliner()
art->free = outliner_main_region_free;
art->listener = outliner_main_region_listener;
art->message_subscribe = outliner_main_region_message_subscribe;
art->context = outliner_main_region_context;
BLI_addhead(&st->regiontypes, art);
/* regions: header */