diff options
author | Clay John <claynjohn@gmail.com> | 2024-10-27 19:25:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-27 19:25:37 -0700 |
commit | a3080477ac0421aef24ca0916c40559abbf4846b (patch) | |
tree | 24e032ad041ae0b6a68d4fdf61d8675e61227c93 | |
parent | 683d11a69f1b0b5b64a183c282c9ad5a27e42cbc (diff) | |
parent | 6424b201e2afa8efab30fd0cb0acc153255f1bd0 (diff) | |
download | redot-engine-a3080477ac0421aef24ca0916c40559abbf4846b.tar.gz |
Merge pull request #98281 from timothyqiu/custom-tooltip-atm
Don't override auto translate mode of custom tooltip
-rw-r--r-- | doc/classes/Control.xml | 2 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 702777466f..d455bd7d68 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -1059,7 +1059,7 @@ </member> <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"> 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]. - [b]Note:[/b] When the tooltip is customized using [method _make_custom_tooltip], this auto translate mode is applied automatically to the returned control. + [b]Note:[/b] Tooltips customized using [method _make_custom_tooltip] do not use this auto translate mode automatically. </member> <member name="tooltip_text" type="String" setter="set_tooltip_text" getter="get_tooltip_text" default=""""> 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]. diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 8755d5f51e..54f66e8d4e 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1478,12 +1478,12 @@ void Viewport::_gui_show_tooltip() { gui.tooltip_label = memnew(Label); gui.tooltip_label->set_theme_type_variation(SNAME("TooltipLabel")); gui.tooltip_label->set_text(gui.tooltip_text); + gui.tooltip_label->set_auto_translate_mode(tooltip_owner->get_tooltip_auto_translate_mode()); base_tooltip = gui.tooltip_label; panel->connect(SceneStringName(mouse_entered), callable_mp(this, &Viewport::_gui_cancel_tooltip)); } base_tooltip->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); - base_tooltip->set_auto_translate_mode(tooltip_owner->get_tooltip_auto_translate_mode()); panel->set_transient(true); panel->set_flag(Window::FLAG_NO_FOCUS, true); |