diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/item_list.cpp | 6 | ||||
-rw-r--r-- | scene/gui/slider.cpp | 6 | ||||
-rw-r--r-- | scene/gui/tab_container.cpp | 9 |
3 files changed, 16 insertions, 5 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index a034c7224f..623a110263 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -489,7 +489,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { if (mb->get_button_index() == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", i, pos); + emit_signal("item_rmb_selected", i, get_local_mouse_position()); } } else { @@ -500,7 +500,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { if (items[i].selected && mb->get_button_index() == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", i, pos); + emit_signal("item_rmb_selected", i, get_local_mouse_position()); } else { bool selected = !items[i].selected; @@ -515,7 +515,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { if (mb->get_button_index() == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", i, pos); + emit_signal("item_rmb_selected", i, get_local_mouse_position()); } else if (/*select_mode==SELECT_SINGLE &&*/ mb->is_doubleclick()) { emit_signal("item_activated", i); diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 116e0ac354..e88742a3e3 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -157,6 +157,12 @@ void Slider::_notification(int p_what) { mouse_inside = false; update(); } break; + case NOTIFICATION_VISIBILITY_CHANGED: // fallthrough + case NOTIFICATION_EXIT_TREE: { + + mouse_inside = false; + grab.active = false; + } break; case NOTIFICATION_DRAW: { RID ci = get_canvas_item(); Size2i size = get_size(); diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 6e50614e8f..cfe924ecd4 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -94,15 +94,20 @@ void TabContainer::_gui_input(const Ref<InputEvent> &p_event) { // Handle navigation buttons. if (buttons_visible_cache) { + int popup_ofs = 0; + if (popup) { + popup_ofs = menu->get_width(); + } + Ref<Texture> increment = get_icon("increment"); Ref<Texture> decrement = get_icon("decrement"); - if (pos.x > size.width - increment->get_width()) { + if (pos.x > size.width - increment->get_width() - popup_ofs) { if (last_tab_cache < tabs.size() - 1) { first_tab_cache += 1; update(); } return; - } else if (pos.x > size.width - increment->get_width() - decrement->get_width()) { + } else if (pos.x > size.width - increment->get_width() - decrement->get_width() - popup_ofs) { if (first_tab_cache > 0) { first_tab_cache -= 1; update(); |