osd: fix flatten anim
This commit is contained in:
parent
a1ed341639
commit
8212be0267
2 changed files with 10 additions and 10 deletions
|
|
@ -6,11 +6,11 @@ import QtQuick.Shapes
|
||||||
Shape {
|
Shape {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property real realWrapperWidth
|
required property real wrapperWidth
|
||||||
required property real wrapperHeight
|
required property real wrapperHeight
|
||||||
readonly property real rounding: BorderConfig.rounding
|
readonly property real rounding: BorderConfig.rounding
|
||||||
readonly property real roundingX: Math.min(rounding, realWrapperWidth / 2)
|
readonly property bool flatten: wrapperWidth < rounding * 2
|
||||||
readonly property real wrapperWidth: realWrapperWidth - 1 // Pixel issues :sob:
|
readonly property real roundingX: flatten ? wrapperWidth / 2 : rounding
|
||||||
|
|
||||||
preferredRendererType: Shape.CurveRenderer
|
preferredRendererType: Shape.CurveRenderer
|
||||||
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
|
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
|
||||||
|
|
@ -19,12 +19,12 @@ Shape {
|
||||||
strokeWidth: -1
|
strokeWidth: -1
|
||||||
fillColor: BorderConfig.colour
|
fillColor: BorderConfig.colour
|
||||||
|
|
||||||
startX: root.wrapperWidth
|
startX: root.wrapperWidth - 1
|
||||||
|
|
||||||
PathArc {
|
PathArc {
|
||||||
relativeX: -root.roundingX
|
relativeX: -root.roundingX
|
||||||
relativeY: root.rounding
|
relativeY: root.rounding
|
||||||
radiusX: root.roundingX
|
radiusX: Math.min(root.rounding, root.wrapperWidth)
|
||||||
radiusY: root.rounding
|
radiusY: root.rounding
|
||||||
}
|
}
|
||||||
PathLine {
|
PathLine {
|
||||||
|
|
@ -34,7 +34,7 @@ Shape {
|
||||||
PathArc {
|
PathArc {
|
||||||
relativeX: -root.roundingX
|
relativeX: -root.roundingX
|
||||||
relativeY: root.rounding
|
relativeY: root.rounding
|
||||||
radiusX: root.roundingX
|
radiusX: Math.min(root.rounding, root.wrapperWidth)
|
||||||
radiusY: root.rounding
|
radiusY: root.rounding
|
||||||
direction: PathArc.Counterclockwise
|
direction: PathArc.Counterclockwise
|
||||||
}
|
}
|
||||||
|
|
@ -44,18 +44,18 @@ Shape {
|
||||||
PathArc {
|
PathArc {
|
||||||
relativeX: root.roundingX
|
relativeX: root.roundingX
|
||||||
relativeY: root.rounding
|
relativeY: root.rounding
|
||||||
radiusX: root.roundingX
|
radiusX: Math.min(root.rounding, root.wrapperWidth)
|
||||||
radiusY: root.rounding
|
radiusY: root.rounding
|
||||||
direction: PathArc.Counterclockwise
|
direction: PathArc.Counterclockwise
|
||||||
}
|
}
|
||||||
PathLine {
|
PathLine {
|
||||||
x: root.wrapperWidth - root.roundingX
|
x: (root.flatten ? root.roundingX : root.wrapperWidth - root.rounding) - 1
|
||||||
relativeY: 0
|
relativeY: 0
|
||||||
}
|
}
|
||||||
PathArc {
|
PathArc {
|
||||||
relativeX: root.roundingX
|
relativeX: root.roundingX
|
||||||
relativeY: root.rounding
|
relativeY: root.rounding
|
||||||
radiusX: root.roundingX
|
radiusX: Math.min(root.rounding, root.wrapperWidth)
|
||||||
radiusY: root.rounding
|
radiusY: root.rounding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,8 @@ Variants {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
wrapperWidth: Math.min(wrapper.width, content.width)
|
||||||
wrapperHeight: wrapper.height
|
wrapperHeight: wrapper.height
|
||||||
realWrapperWidth: Math.min(wrapper.width, content.width)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerShadow {
|
LayerShadow {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue