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()
onWidthChanged: updateTabPosition()
onHeightChanged: updateTabPosition()
function updateTabPosition() {
onCurrentTabChanged: {
if (!currentTab) {
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 {
id: tabbarScroller
clip: true