summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-10-20 13:04:25 +0200
committerGitHub <noreply@github.com>2017-10-20 13:04:25 +0200
commit0e8db63009fdbc586829565d86f0974b95b1cd9e (patch)
treedd29239f586247d26a3e53779603b8baa932e002 /scene/gui
parent7f477dae261d7c4684a1e29d780ff54220a7634a (diff)
parentc91c22b1f3afc57e282ff589ec5139413e1e1dd1 (diff)
Merge pull request #12084 from santouits/tab_container_bug
tab container arrows don't work when a popup was set [ci skip]
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/tab_container.cpp9
1 files changed, 7 insertions, 2 deletions
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();