add the drawing popout background
This commit is contained in:
+25
-77
@@ -12,90 +12,29 @@ Item {
|
|||||||
|
|
||||||
required property Canvas drawing
|
required property Canvas drawing
|
||||||
property bool expanded: true
|
property bool expanded: true
|
||||||
|
property real offsetScale: shouldBeActive ? 0 : 1
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
readonly property bool shouldBeActive: visibilities.isDrawing
|
readonly property bool shouldBeActive: visibilities.isDrawing
|
||||||
required property var visibilities
|
required property var visibilities
|
||||||
|
|
||||||
|
anchors.leftMargin: (-implicitWidth - 5) * offsetScale
|
||||||
implicitHeight: content.implicitHeight
|
implicitHeight: content.implicitHeight
|
||||||
implicitWidth: 0
|
implicitWidth: root.expanded ? content.implicitWidth : icon.implicitWidth
|
||||||
visible: width > 0
|
opacity: 1 - offsetScale
|
||||||
|
visible: offsetScale < 1
|
||||||
|
|
||||||
states: [
|
Behavior on implicitWidth {
|
||||||
State {
|
Anim {
|
||||||
name: "hidden"
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
when: !root.shouldBeActive
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
root.implicitWidth: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
icon.opacity: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
content.opacity: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "collapsed"
|
|
||||||
when: root.shouldBeActive && !root.expanded
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
root.implicitWidth: icon.implicitWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
icon.opacity: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
content.opacity: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "visible"
|
|
||||||
when: root.shouldBeActive && root.expanded
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
root.implicitWidth: content.implicitWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
icon.opacity: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
content.opacity: 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
transitions: [
|
Behavior on offsetScale {
|
||||||
Transition {
|
Anim {
|
||||||
from: "*"
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
to: "*"
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
|
|
||||||
ParallelAnimation {
|
|
||||||
Anim {
|
|
||||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
|
||||||
property: "implicitWidth"
|
|
||||||
target: root
|
|
||||||
}
|
|
||||||
|
|
||||||
Anim {
|
|
||||||
duration: Appearance.anim.durations.small
|
|
||||||
property: "opacity"
|
|
||||||
target: icon
|
|
||||||
}
|
|
||||||
|
|
||||||
Anim {
|
|
||||||
duration: Appearance.anim.durations.small
|
|
||||||
property: "opacity"
|
|
||||||
target: content
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (!visible)
|
if (!visible)
|
||||||
@@ -109,8 +48,12 @@ Item {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
height: content.contentItem.height
|
height: content.contentItem.height
|
||||||
opacity: 1
|
opacity: root.expanded ? 0 : 1
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
sourceComponent: MaterialIcon {
|
sourceComponent: MaterialIcon {
|
||||||
font.pointSize: Appearance.font.size.larger
|
font.pointSize: Appearance.font.size.larger
|
||||||
text: "arrow_forward_ios"
|
text: "arrow_forward_ios"
|
||||||
@@ -122,7 +65,12 @@ Item {
|
|||||||
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
opacity: root.expanded ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
sourceComponent: Content {
|
sourceComponent: Content {
|
||||||
drawing: root.drawing
|
drawing: root.drawing
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
|
|||||||
Reference in New Issue
Block a user