Skip to content

Commit bfe246c

Browse files
committed
Merge pull request #90922 from YeldhamDev/so_many_popupmenu_bugs
Fix wrong tooltip behavior in `PopupMenu`s that have styles with top borders
2 parents ac5c6a1 + 565b21b commit bfe246c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scene/main/viewport.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,11 @@ String Viewport::_gui_get_tooltip(Control *p_control, const Vector2 &p_pos, Cont
15391539
// Temporary solution for PopupMenus.
15401540
PopupMenu *menu = Object::cast_to<PopupMenu>(this);
15411541
if (menu) {
1542+
Ref<StyleBox> sb = menu->get_theme_stylebox(SceneStringName(panel));
1543+
if (sb.is_valid()) {
1544+
pos.y += sb->get_margin(SIDE_TOP);
1545+
}
1546+
15421547
tooltip = menu->get_tooltip(pos);
15431548
}
15441549

0 commit comments

Comments
 (0)