aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde2016-05-01 16:48:55 +0200
committerRémi Verschelde2016-05-06 11:06:42 +0200
commitef2f1ae811f8230332bc598a2bd61385cda1acd1 (patch)
treed8a8559356f585995aa6084925bbffd00b0ed7bb
parent7c419032c767d224f3cc318bf6ed6aa30700bd00 (diff)
downloadgodot-ef2f1ae811f8230332bc598a2bd61385cda1acd1.tar.gz
godot-ef2f1ae811f8230332bc598a2bd61385cda1acd1.tar.zst
godot-ef2f1ae811f8230332bc598a2bd61385cda1acd1.zip
Tabs: Fix align issue with right/close buttons
The stylebox around the close button was badly centered. There were also bad margins applied when using right buttons. (cherry picked from commit 21c181bd3ce5c13b346f44af362a779e742ec344)
-rw-r--r--scene/gui/tabs.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index 10eee2795..eb060aa6b 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -348,11 +348,8 @@ void Tabs::_notification(int p_what) {
style->draw(ci,rb_rect);
}
- w+=style->get_margin(MARGIN_LEFT);
-
- rb->draw(ci,Point2i( w,rb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
+ rb->draw(ci,Point2i( w+style->get_margin(MARGIN_LEFT), rb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
w+=rb->get_width();
- w+=style->get_margin(MARGIN_RIGHT);
tabs[i].rb_rect=rb_rect;
}
@@ -376,7 +373,7 @@ void Tabs::_notification(int p_what) {
style->draw(ci,cb_rect);
}
- cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
+ cb->draw(ci,Point2i( w+style->get_margin(MARGIN_LEFT), cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
w+=cb->get_width();
tabs[i].cb_rect=cb_rect;
}