Browse Source

tab container arrows don't work when a popup was set

santouits 7 years ago
parent
commit
c91c22b1f3
1 changed files with 7 additions and 2 deletions
  1. 7 2
      scene/gui/tab_container.cpp

+ 7 - 2
scene/gui/tab_container.cpp

@@ -94,15 +94,20 @@ void TabContainer::_gui_input(const Ref<InputEvent> &p_event) {
 
 
 		// Handle navigation buttons.
 		// Handle navigation buttons.
 		if (buttons_visible_cache) {
 		if (buttons_visible_cache) {
+			int popup_ofs = 0;
+			if (popup) {
+				popup_ofs = menu->get_width();
+			}
+
 			Ref<Texture> increment = get_icon("increment");
 			Ref<Texture> increment = get_icon("increment");
 			Ref<Texture> decrement = get_icon("decrement");
 			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) {
 				if (last_tab_cache < tabs.size() - 1) {
 					first_tab_cache += 1;
 					first_tab_cache += 1;
 					update();
 					update();
 				}
 				}
 				return;
 				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) {
 				if (first_tab_cache > 0) {
 					first_tab_cache -= 1;
 					first_tab_cache -= 1;
 					update();
 					update();