Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion scene/gui/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3253,7 +3253,16 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, int
if (!c.text.is_empty()) {
_update_popup_menu(c);
popup_menu->set_size(Size2(col_width, 0));
popup_menu->set_position(get_screen_position() + Point2i(col_ofs, _get_title_button_height() + y_ofs + item_h) - theme_cache.offset);

int pos_x = 0;
Point2 panel_ofs = theme_cache.panel_style->get_offset();
if (is_layout_rtl()) {
pos_x = get_size().width - col_ofs - panel_ofs.x - popup_menu->get_size().width;
} else {
pos_x = col_ofs + panel_ofs.x;
}
popup_menu->set_position(get_screen_position() + Point2i(pos_x, _get_title_button_height() + y_ofs + item_h + panel_ofs.y) - theme_cache.offset);

popup_menu->popup();
popup_edited_item = p_item;
popup_edited_item_col = col;
Expand Down Expand Up @@ -3503,6 +3512,7 @@ void Tree::value_editor_changed(double p_value) {
void Tree::_update_popup_menu(const TreeItem::Cell &p_cell) {
if (popup_menu == nullptr) {
popup_menu = memnew(PopupMenu);
popup_menu->set_shrink_width(false);
popup_menu->hide();
add_child(popup_menu, false, INTERNAL_MODE_FRONT);
popup_menu->connect(SceneStringName(id_pressed), callable_mp(this, &Tree::popup_select));
Expand Down