Revert "Fix incorrect initial tabs position for vertical tab bars"

I committed this patch without the author's attribution, sorry
This reverts commit e2cd97d822.
This commit is contained in:
Nate Graham 2019-08-08 20:32:28 -06:00
parent e2cd97d822
commit d186d5421b

View File

@ -171,11 +171,7 @@ FocusScope {
} }
} }
onCurrentTabChanged: updateTabPosition() onCurrentTabChanged: {
onWidthChanged: updateTabPosition()
onHeightChanged: updateTabPosition()
function updateTabPosition() {
if (!currentTab) { if (!currentTab) {
return; return;
} }
@ -186,6 +182,16 @@ FocusScope {
} }
} }
onWidthChanged: {
if (currentTab) {
if (layout.isHorizontal) {
tabBarLayout.x = Math.max(Math.min(0, -(currentTab.x + currentTab.width/2) + tabbarScroller.width/2), -tabBarLayout.width + tabbarScroller.width);
} else {
tabBarLayout.y = Math.max(Math.min(0, -(currentTab.y + currentTab.height/2) + tabbarScroller.height/2), -tabBarLayout.height + tabbarScroller.height);
}
}
}
Item { Item {
id: tabbarScroller id: tabbarScroller
clip: true clip: true