summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorrequizm <mehmet41650@gmail.com>2021-08-20 12:49:19 +0300
committerrequizm <mehmet41650@gmail.com>2021-08-20 23:06:00 +0300
commit6f3d8fa228c6b4719206efe0db137356fabfa7f7 (patch)
tree39f9eb22ae3f6969652b51e21f3cb21fee19d90e /scene/main
parent6cea7ebae4721e05ea7013c6159a751f7498ea85 (diff)
Fix tooltip message working incorrectly in PopupMenu
fix
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 78fa0985a9..83406842c6 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -45,6 +45,7 @@
#include "scene/gui/control.h"
#include "scene/gui/label.h"
#include "scene/gui/popup.h"
+#include "scene/gui/popup_menu.h"
#include "scene/main/canvas_layer.h"
#include "scene/main/window.h"
#include "scene/resources/mesh.h"
@@ -1104,6 +1105,12 @@ String Viewport::_gui_get_tooltip(Control *p_control, const Vector2 &p_pos, Cont
while (p_control) {
tooltip = p_control->get_tooltip(pos);
+ //Temporary solution for PopupMenus
+ PopupMenu *menu = Object::cast_to<PopupMenu>(this);
+ if (menu) {
+ tooltip = menu->get_tooltip(pos);
+ }
+
if (r_tooltip_owner) {
*r_tooltip_owner = p_control;
}