diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/base_button.cpp | 8 | ||||
-rw-r--r-- | scene/gui/label.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 148277f2dd..a67fe2aeeb 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -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; } diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index e1f77594da..51a25c60a1 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -207,7 +207,7 @@ void Label::_notification(int p_what) { } break; } - int y_ofs = style->get_offset().y; + float y_ofs = style->get_offset().y; y_ofs += (line - lines_skipped) * font_h + font->get_ascent(); y_ofs += vbegin + line * vsep; |