test popouts
This commit is contained in:
+13
-6
@@ -9,13 +9,20 @@ Item {
|
||||
id: root
|
||||
|
||||
readonly property alias content: content
|
||||
property real offsetScale: x > 0 || content.hasCurrent ? 0 : 1
|
||||
property real offsetScale: y > 0 || content.hasCurrent ? 0 : 1
|
||||
required property ShellScreen screen
|
||||
|
||||
clip: true
|
||||
implicitHeight: content.implicitHeight
|
||||
implicitWidth: content.implicitWidth * (1 - offsetScale)
|
||||
implicitHeight: content.implicitHeight * (1 - offsetScale)
|
||||
implicitWidth: content.implicitWidth
|
||||
visible: width > 0 && height > 0
|
||||
x: {
|
||||
const off = content.currentCenter - content.nonAnimWidth / 2;
|
||||
const diff = parent.width - Math.floor(off + content.nonAnimWidth);
|
||||
if (diff < 0)
|
||||
return off + diff;
|
||||
return Math.floor(Math.max(off, 0));
|
||||
}
|
||||
|
||||
Behavior on offsetScale {
|
||||
Anim {
|
||||
@@ -41,9 +48,9 @@ Item {
|
||||
Wrapper {
|
||||
id: content
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: (-implicitWidth - 5) * root.offsetScale
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: (-implicitHeight - 5) * root.offsetScale
|
||||
offsetScale: root.offsetScale
|
||||
screen: root.screen
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user