You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Consistent display of shortcut names in tooltips
This commit is contained in:
@@ -450,11 +450,11 @@ String BaseButton::get_tooltip(const Point2 &p_pos) const {
|
||||
|
||||
String tooltip = Control::get_tooltip(p_pos);
|
||||
if (shortcut.is_valid() && shortcut->is_valid()) {
|
||||
if (tooltip.find("$sc") != -1) {
|
||||
tooltip = tooltip.replace_first("$sc", "(" + shortcut->get_as_text() + ")");
|
||||
} else {
|
||||
tooltip += " (" + shortcut->get_as_text() + ")";
|
||||
String text = shortcut->get_name() + " (" + shortcut->get_as_text() + ")";
|
||||
if (shortcut->get_name().nocasecmp_to(tooltip) != 0) {
|
||||
text += "\n" + tooltip;
|
||||
}
|
||||
tooltip = text;
|
||||
}
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user