You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Consistent display of shortcut names in tooltips
This commit is contained in:
@@ -4100,7 +4100,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|||||||
select_button->connect("pressed", this, "_tool_select", make_binds(TOOL_SELECT));
|
select_button->connect("pressed", this, "_tool_select", make_binds(TOOL_SELECT));
|
||||||
select_button->set_pressed(true);
|
select_button->set_pressed(true);
|
||||||
select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), KEY_Q));
|
select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), KEY_Q));
|
||||||
select_button->set_tooltip(TTR("Select Mode") + " $sc\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate") + "\n" + TTR("Alt+Drag: Move") + "\n" + TTR("Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving).") + "\n" + TTR("Alt+RMB: Depth list selection"));
|
select_button->set_tooltip(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate") + "\n" + TTR("Alt+Drag: Move") + "\n" + TTR("Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving).") + "\n" + TTR("Alt+RMB: Depth list selection"));
|
||||||
|
|
||||||
move_button = memnew(ToolButton);
|
move_button = memnew(ToolButton);
|
||||||
hb->add_child(move_button);
|
hb->add_child(move_button);
|
||||||
|
|||||||
@@ -450,11 +450,11 @@ String BaseButton::get_tooltip(const Point2 &p_pos) const {
|
|||||||
|
|
||||||
String tooltip = Control::get_tooltip(p_pos);
|
String tooltip = Control::get_tooltip(p_pos);
|
||||||
if (shortcut.is_valid() && shortcut->is_valid()) {
|
if (shortcut.is_valid() && shortcut->is_valid()) {
|
||||||
if (tooltip.find("$sc") != -1) {
|
String text = shortcut->get_name() + " (" + shortcut->get_as_text() + ")";
|
||||||
tooltip = tooltip.replace_first("$sc", "(" + shortcut->get_as_text() + ")");
|
if (shortcut->get_name().nocasecmp_to(tooltip) != 0) {
|
||||||
} else {
|
text += "\n" + tooltip;
|
||||||
tooltip += " (" + shortcut->get_as_text() + ")";
|
|
||||||
}
|
}
|
||||||
|
tooltip = text;
|
||||||
}
|
}
|
||||||
return tooltip;
|
return tooltip;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user