Fix incorrect initial tabs position for vertical tab bars
Summary: This fixes the incorrect initial positioning of the tabs for vertical tab bars that persisted until the user switched to another tab manually. BUG: 395390 FIXED-IN: 5.62 Reviewers: #plasma, ngraham, hein Reviewed By: #plasma, ngraham, hein Subscribers: kde-frameworks-devel Tags: #frameworks Maniphest Tasks: T10047 Differential Revision: https://phabricator.kde.org/D23036
This commit is contained in:
parent
d186d5421b
commit
144bb90715
@ -171,7 +171,11 @@ FocusScope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onCurrentTabChanged: {
|
onCurrentTabChanged: updateTabPosition()
|
||||||
|
onWidthChanged: updateTabPosition()
|
||||||
|
onHeightChanged: updateTabPosition()
|
||||||
|
|
||||||
|
function updateTabPosition() {
|
||||||
if (!currentTab) {
|
if (!currentTab) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -182,16 +186,6 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user