proper tab button size
This commit is contained in:
parent
8d327acc6f
commit
c56534ba47
@ -76,6 +76,8 @@ FocusScope {
|
|||||||
//Plasma extension
|
//Plasma extension
|
||||||
property Item currentTab
|
property Item currentTab
|
||||||
|
|
||||||
|
clip: true
|
||||||
|
|
||||||
implicitWidth: layout.implicitWidth + backgroundFrame.margins.left + backgroundFrame.margins.right
|
implicitWidth: layout.implicitWidth + backgroundFrame.margins.left + backgroundFrame.margins.right
|
||||||
implicitHeight: layout.implicitHeight + backgroundFrame.margins.top + backgroundFrame.margins.bottom
|
implicitHeight: layout.implicitHeight + backgroundFrame.margins.top + backgroundFrame.margins.bottom
|
||||||
|
|
||||||
@ -87,15 +89,14 @@ FocusScope {
|
|||||||
prefix: "sunken"
|
prefix: "sunken"
|
||||||
}
|
}
|
||||||
|
|
||||||
clip: true
|
|
||||||
PlasmaCore.FrameSvgItem {
|
PlasmaCore.FrameSvgItem {
|
||||||
id: buttonFrame
|
id: buttonFrame
|
||||||
|
|
||||||
visible: currentTab !== null
|
visible: currentTab !== null
|
||||||
x: tabBarLayout.x + currentTab.x + backgroundFrame.margins.left
|
x: tabBarLayout.x + currentTab.x + backgroundFrame.margins.left
|
||||||
y: backgroundFrame.margins.top
|
y: backgroundFrame.margins.top
|
||||||
width: currentTab.width
|
width: currentTab.width + margins.left + margins.right
|
||||||
height: currentTab.height + buttonFrame.margins.top + buttonFrame.margins.bottom
|
height: currentTab.height + margins.top + margins.bottom
|
||||||
imagePath: "widgets/button"
|
imagePath: "widgets/button"
|
||||||
prefix: "normal"
|
prefix: "normal"
|
||||||
Behavior on x {
|
Behavior on x {
|
||||||
@ -108,10 +109,6 @@ FocusScope {
|
|||||||
|
|
||||||
onCurrentTabChanged: tabBarLayout.x = Math.max(Math.min(0, -(currentTab.x + currentTab.width/2) + tabbarScroller.width/2), -tabBarLayout.width + tabbarScroller.width)
|
onCurrentTabChanged: tabBarLayout.x = Math.max(Math.min(0, -(currentTab.x + currentTab.width/2) + tabbarScroller.width/2), -tabBarLayout.width + tabbarScroller.width)
|
||||||
|
|
||||||
Text {
|
|
||||||
text: tabBarLayout.implicitWidth + " " + tabBarLayout.width + " " + tabbarScroller.width
|
|
||||||
}
|
|
||||||
|
|
||||||
onWidthChanged: tabBarLayout.x = Math.max(Math.min(0, -(currentTab.x + currentTab.width/2) + tabbarScroller.width/2), -tabBarLayout.width + tabbarScroller.width)
|
onWidthChanged: tabBarLayout.x = Math.max(Math.min(0, -(currentTab.x + currentTab.width/2) + tabbarScroller.width/2), -tabBarLayout.width + tabbarScroller.width)
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user