UI: Always Use Mono Font for Python in Tooltips

When including Python on the tooltips they are meant to be shown using
a monospaced font. This is the case in two of the four places that
python is shown, but not in the other two which include Tool tooltips.
This PR makes them all consistent.

Pull Request: https://projects.blender.org/blender/blender/pulls/125521
This commit is contained in:
Harley Acheson
2024-07-27 01:51:41 +02:00
committed by Harley Acheson
parent f217dad8de
commit 9bdd511a27

View File

@@ -414,7 +414,7 @@ static bool ui_tooltip_data_append_from_keymap(bContext *C, uiTooltipData &data,
if (U.flag & USER_TOOLTIPS_PYTHON) {
std::string str = ui_tooltip_text_python_from_op(C, ot, kmi->ptr);
UI_tooltip_text_field_add(
data, fmt::format(TIP_("Python: {}"), str), {}, UI_TIP_STYLE_NORMAL, UI_TIP_LC_PYTHON);
data, fmt::format(TIP_("Python: {}"), str), {}, UI_TIP_STYLE_MONO, UI_TIP_LC_PYTHON);
}
}
@@ -721,7 +721,7 @@ static std::unique_ptr<uiTooltipData> ui_tooltip_data_from_tool(bContext *C,
UI_tooltip_text_field_add(*data,
fmt::format(TIP_("Python: {}"), str),
{},
UI_TIP_STYLE_NORMAL,
UI_TIP_STYLE_MONO,
UI_TIP_LC_PYTHON,
true);
}