Skip to content

Commit a308047

Browse files
authored
Merge pull request godotengine#98281 from timothyqiu/custom-tooltip-atm
Don't override auto translate mode of custom tooltip
2 parents 683d11a + 6424b20 commit a308047

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/classes/Control.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@
10591059
</member>
10601060
<member name="tooltip_auto_translate_mode" type="int" setter="set_tooltip_auto_translate_mode" getter="get_tooltip_auto_translate_mode" enum="Node.AutoTranslateMode" default="0">
10611061
Defines if tooltip text should automatically change to its translated version depending on the current locale. Uses the same auto translate mode as this control when set to [constant Node.AUTO_TRANSLATE_MODE_INHERIT].
1062-
[b]Note:[/b] When the tooltip is customized using [method _make_custom_tooltip], this auto translate mode is applied automatically to the returned control.
1062+
[b]Note:[/b] Tooltips customized using [method _make_custom_tooltip] do not use this auto translate mode automatically.
10631063
</member>
10641064
<member name="tooltip_text" type="String" setter="set_tooltip_text" getter="get_tooltip_text" default="&quot;&quot;">
10651065
The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. The time required for the tooltip to appear can be changed with the [member ProjectSettings.gui/timers/tooltip_delay_sec] option. See also [method get_tooltip].

scene/main/viewport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,12 +1478,12 @@ void Viewport::_gui_show_tooltip() {
14781478
gui.tooltip_label = memnew(Label);
14791479
gui.tooltip_label->set_theme_type_variation(SNAME("TooltipLabel"));
14801480
gui.tooltip_label->set_text(gui.tooltip_text);
1481+
gui.tooltip_label->set_auto_translate_mode(tooltip_owner->get_tooltip_auto_translate_mode());
14811482
base_tooltip = gui.tooltip_label;
14821483
panel->connect(SceneStringName(mouse_entered), callable_mp(this, &Viewport::_gui_cancel_tooltip));
14831484
}
14841485

14851486
base_tooltip->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
1486-
base_tooltip->set_auto_translate_mode(tooltip_owner->get_tooltip_auto_translate_mode());
14871487

14881488
panel->set_transient(true);
14891489
panel->set_flag(Window::FLAG_NO_FOCUS, true);

0 commit comments

Comments
 (0)