correct cuttong of the button in case of scrolling
This commit is contained in:
parent
c56534ba47
commit
e7a5a5fbcf
@ -76,8 +76,6 @@ 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
|
||||||
|
|
||||||
@ -89,24 +87,66 @@ FocusScope {
|
|||||||
prefix: "sunken"
|
prefix: "sunken"
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
Item {
|
||||||
id: buttonFrame
|
id: buttonCutter
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
leftMargin: 1
|
||||||
|
rightMargin: (buttonsLayout.visible ? buttonsLayout.width : 0) + 1
|
||||||
|
}
|
||||||
|
clip: true
|
||||||
|
PlasmaCore.FrameSvgItem {
|
||||||
|
id: buttonFrame
|
||||||
|
|
||||||
visible: currentTab !== null
|
visible: currentTab !== null
|
||||||
x: tabBarLayout.x + currentTab.x + backgroundFrame.margins.left
|
x: tabBarLayout.x + currentTab.x + backgroundFrame.margins.left -1
|
||||||
y: backgroundFrame.margins.top
|
y: backgroundFrame.margins.top
|
||||||
width: currentTab.width + margins.left + margins.right
|
width: currentTab.width + margins.left + margins.right -1
|
||||||
height: currentTab.height + margins.top + 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 {
|
||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
easing.type: Easing.InQuad
|
easing.type: Easing.InQuad
|
||||||
duration: 250
|
duration: 250
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlasmaCore.Svg {
|
||||||
|
id: scrollWidgetSvg
|
||||||
|
imagePath: "widgets/scrollwidget"
|
||||||
|
}
|
||||||
|
PlasmaCore.SvgItem {
|
||||||
|
svg: scrollWidgetSvg
|
||||||
|
elementId: "border-left"
|
||||||
|
width: naturalSize.width
|
||||||
|
visible: buttonsLayout.visible
|
||||||
|
anchors {
|
||||||
|
left: buttonCutter.left
|
||||||
|
leftMargin: -1
|
||||||
|
top: buttonCutter.top
|
||||||
|
bottom: buttonCutter.bottom
|
||||||
|
topMargin: backgroundFrame.margins.top
|
||||||
|
bottomMargin: backgroundFrame.margins.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PlasmaCore.SvgItem {
|
||||||
|
svg: scrollWidgetSvg
|
||||||
|
elementId: "border-right"
|
||||||
|
width: naturalSize.width
|
||||||
|
visible: buttonsLayout.visible
|
||||||
|
anchors {
|
||||||
|
right: buttonCutter.right
|
||||||
|
rightMargin: -1
|
||||||
|
top: buttonCutter.top
|
||||||
|
bottom: buttonCutter.bottom
|
||||||
|
topMargin: backgroundFrame.margins.top
|
||||||
|
bottomMargin: backgroundFrame.margins.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
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)
|
||||||
@ -118,7 +158,7 @@ FocusScope {
|
|||||||
fill: parent
|
fill: parent
|
||||||
leftMargin: backgroundFrame.margins.left + buttonFrame.margins.left
|
leftMargin: backgroundFrame.margins.left + buttonFrame.margins.left
|
||||||
topMargin: backgroundFrame.margins.top + buttonFrame.margins.top
|
topMargin: backgroundFrame.margins.top + buttonFrame.margins.top
|
||||||
rightMargin: backgroundFrame.margins.right + buttonFrame.margins.right + (buttonsLayout.visible ? buttonsLayout.width : 0)
|
rightMargin: backgroundFrame.margins.right + (buttonsLayout.visible ? buttonsLayout.width : buttonFrame.margins.right)
|
||||||
bottomMargin: backgroundFrame.margins.bottom + buttonFrame.margins.bottom
|
bottomMargin: backgroundFrame.margins.bottom + buttonFrame.margins.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user