Add tooltip_set and PopupHelper::begin, and use localize_format
149 localized tooltips, 38 localized formats and 27 modal popups lose their boilerplate.
This commit is contained in:
1 parent
99e06b72ea
commit
8d3ebf2329
31 files changed
+308
-362
No files matched your search
+2
-2
@@ -100,7 +100,7 @@ static void action_items_menu_draw(std::vector<Action>& items, Settings& setting
|
||||
if (ImGui::MenuItem(localize.get(action.label), shortcutLabel, false, is_action_enabled(action)) && action.run)
|
||||
action.run();
|
||||
if (action.tooltip != STRING_UNDEFINED && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
|
||||
ImGui::SetItemTooltip("%s", localize.get(action.tooltip));
|
||||
tooltip_set(action.tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ void action_button_draw(Action& action, Manager& manager, Settings& settings, Im
|
||||
{
|
||||
auto shortcutText = action_shortcut_text_get(action, settings);
|
||||
if (shortcutText.empty())
|
||||
ImGui::SetItemTooltip("%s", localize.get(action.tooltip));
|
||||
tooltip_set(action.tooltip);
|
||||
else
|
||||
set_item_tooltip_shortcut(localize.get(action.tooltip), shortcutText);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user