Fix #119384: Outliner Edit Mode Toggle When Data is Shared #119704

Merged
Harley Acheson merged 2 commits from Harley/blender:fix119384 into blender-v4.1-release 2024-03-22 18:26:40 +01:00
1 changed files with 20 additions and 0 deletions

View File

@ -2189,6 +2189,26 @@ static void outliner_draw_mode_column_toggle(uiBlock *block,
return;
}
if (ob->mode == OB_MODE_OBJECT && BKE_object_is_in_editmode(ob)) {
/* Another object has our (shared) data in edit mode, so nothing we can change. */
uiBut *but = uiDefIconBut(block,
UI_BTYPE_BUT,
0,
UI_icon_from_object_mode(ob_active->mode),
0,
te->ys,
Harley marked this conversation as resolved
Review

To avoid the need to reuse icon and tip and move their declarations higher up

    uiBut *but = uiDefIconBut(block,
                              UI_BTYPE_BUT,
                              0,
                              UI_icon_from_object_mode(ob_active->mode),
                              0,
                              te->ys,
                              UI_UNIT_X,
                              UI_UNIT_Y,
                              nullptr,
                              0.0,
                              0.0,
                              0.0,
                              0.0,
                              TIP_("Shared data already in edit mode"));
To avoid the need to reuse `icon` and `tip` and move their declarations higher up ``` uiBut *but = uiDefIconBut(block, UI_BTYPE_BUT, 0, UI_icon_from_object_mode(ob_active->mode), 0, te->ys, UI_UNIT_X, UI_UNIT_Y, nullptr, 0.0, 0.0, 0.0, 0.0, TIP_("Shared data already in edit mode")); ```
UI_UNIT_X,
UI_UNIT_Y,
nullptr,
0.0,
0.0,
0.0,
0.0,
TIP_("Another object has this shared data in edit mode"));
UI_but_flag_enable(but, UI_BUT_DISABLED);
return;
}
bool draw_active_icon = ob->mode == ob_active->mode;
/* When not locking object modes, objects can remain in non-object modes. For modes that do not