Skip to main content

without_argument_hint

Function without_argument_hint 

Source
pub fn without_argument_hint(title: &str) -> &str
Expand description

A command’s title as a menu, a toolbar or a tray shows it: without the trailing hint of its arguments (Open a workspace (`path`) reads Open a workspace), which only the palette, where arguments are typed, keeps. It works on a translated title as on the English one.

use egui_pop_core::strings::without_argument_hint;

assert_eq!(without_argument_hint("Open a workspace (`path`)"), "Open a workspace");
assert_eq!(without_argument_hint("Ouvrir (`chemin` : un dossier)"), "Ouvrir");
assert_eq!(without_argument_hint("Zoom (fit)"), "Zoom (fit)");