Fix #134166: Show Context Menus as "Options" on Status Bar

The Status Bar often shows context menu items as the name of that menu,
which is confusing in this context. For example in Object mode it shows
"Object" as the right-click operation. In Grease Pencil it shows this
as "Draw" even though you don't draw with it. In "Sculpt" mode you see
two items as "Sculpt", one on left click and the other on right click.
This PR makes all these show as "Options" instead. This seems like a
very succinct description of what is available on right-click.

Pull Request: https://projects.blender.org/blender/blender/pulls/134191
This commit is contained in:
Harley Acheson
2025-02-06 20:15:44 +01:00
committed by Harley Acheson
parent 59db8d427f
commit fd97a8f578

View File

@@ -6585,9 +6585,21 @@ void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win)
}
if (kmi) {
wmOperatorType *ot = WM_operatortype_find(kmi->idname, false);
const std::string operator_name = WM_operatortype_name(ot, kmi->ptr);
const char *name = (ot) ? operator_name.c_str() : kmi->idname;
STRNCPY(cd->text[button_index][type_index], name);
std::string name;
if (kmi->type == RIGHTMOUSE && kmi->val == KM_PRESS &&
STR_ELEM(kmi->idname, "WM_OT_call_menu", "WM_OT_call_menu_pie", "WM_OT_call_panel"))
{
name = TIP_("Options");
}
else if (ot) {
name = WM_operatortype_name(ot, kmi->ptr);
}
else {
name = kmi->idname;
}
STRNCPY(cd->text[button_index][type_index], name.c_str());
}
}