globe v1
This commit is contained in:
1 parent
b127fc2256
commit
0f42427f94
8 files changed
+600
-323
No files matched your search
@@ -1,9 +1,10 @@
|
||||
import QtQuick
|
||||
|
||||
// The windows of one workspace sit on a strip bent into a closed loop, seen
|
||||
// from a little above. The front half shows the outside of the strip, the
|
||||
// back half shows the inside, so the far windows wrap around behind and
|
||||
// face the viewer too.
|
||||
// The windows of one workspace orbit a small planet on a strip bent into a
|
||||
// closed loop, seen from a little above. The front half shows the outside
|
||||
// of the strip, the back half shows the inside, so the far windows wrap
|
||||
// around behind and face the viewer too. With only a few windows they sit
|
||||
// flat, side by side. The loop sits right of the middle, beside the globe.
|
||||
Item {
|
||||
id: root
|
||||
|
||||
@@ -30,9 +31,10 @@ Item {
|
||||
// included.
|
||||
readonly property real reachX: ring.reachX
|
||||
|
||||
// Top and bottom edges of the front window, from the middle of the view.
|
||||
readonly property real frontTop: root.theme.loopBackLift / 2 - root.theme.loopCardHeight / 2
|
||||
readonly property real frontBottom: root.theme.loopBackLift / 2 + root.theme.loopCardHeight / 2
|
||||
// How far right of the middle the loop sits while open, so its right
|
||||
// edge stays loopScreenGap from the screen edge. It starts in the
|
||||
// middle, where the selected workspace was.
|
||||
property real shiftX: root.expanded ? Math.max(0, root.width / 2 - root.reachX - root.theme.loopScreenGap) : 0
|
||||
|
||||
// Selected step. It is not wrapped, so the loop can keep turning the
|
||||
// same way. Use selectedIndex for the position in the window list.
|
||||
@@ -74,6 +76,12 @@ Item {
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Behavior on shiftX {
|
||||
NumberAnimation {
|
||||
duration: root.theme.loopExpandDuration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Behavior on turn {
|
||||
enabled: root.animate
|
||||
NumberAnimation {
|
||||
@@ -214,75 +222,83 @@ Item {
|
||||
root.activateAt(root.selectedIndex);
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
anchors.verticalCenterOffset: root.slideY
|
||||
opacity: root.switchFade
|
||||
visible: root.count === 0
|
||||
color: root.theme.labelColor
|
||||
font.pixelSize: root.theme.loopEmptySize
|
||||
text: "No windows on this workspace"
|
||||
}
|
||||
|
||||
// Zero sized point at the loop center. Pushed down by half the lift
|
||||
// so the loop as a whole sits in the middle.
|
||||
// Moved sideways by shiftX.
|
||||
Item {
|
||||
id: stage
|
||||
anchors.centerIn: parent
|
||||
anchors.verticalCenterOffset: root.theme.loopBackLift / 2
|
||||
id: content
|
||||
width: root.width
|
||||
height: root.height
|
||||
x: root.shiftX
|
||||
|
||||
// The old workspace, folding away.
|
||||
WindowRing {
|
||||
id: leavingRing
|
||||
y: root.leavingY
|
||||
z: 0
|
||||
opacity: root.leavingFade
|
||||
visible: leavingRing.opacity > 0
|
||||
enabled: false
|
||||
compositor: root.compositor
|
||||
theme: root.theme
|
||||
windows: root.leavingWindows
|
||||
maxRadius: root.width * root.theme.loopMaxRadiusShare
|
||||
turn: root.leavingTurn
|
||||
selectedIndex: root.leavingIndex
|
||||
live: root.expanded
|
||||
// Its previews are already out, so they should not grow again.
|
||||
growPreview: false
|
||||
gather: root.leavingGather
|
||||
}
|
||||
|
||||
WindowRing {
|
||||
id: ring
|
||||
y: root.slideY
|
||||
z: 1
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
anchors.verticalCenterOffset: root.slideY
|
||||
opacity: root.switchFade
|
||||
enabled: root.expanded
|
||||
compositor: root.compositor
|
||||
theme: root.theme
|
||||
windows: root.windows
|
||||
maxRadius: root.width * root.theme.loopMaxRadiusShare
|
||||
turn: root.turn
|
||||
selectedIndex: root.selectedIndex
|
||||
live: root.expanded
|
||||
growPreview: true
|
||||
gather: root.gather
|
||||
|
||||
onActivated: index => root.activateAt(index)
|
||||
visible: root.count === 0
|
||||
color: root.theme.labelColor
|
||||
font.pixelSize: root.theme.loopEmptySize
|
||||
text: "No windows on this workspace"
|
||||
}
|
||||
|
||||
// Under the front window, above both rings.
|
||||
// Zero sized point in the middle. Each ring is pushed down by half
|
||||
// the lift, unless flat, so it sits in the middle as a whole.
|
||||
Item {
|
||||
y: root.slideY
|
||||
z: 2
|
||||
opacity: root.switchFade
|
||||
id: stage
|
||||
anchors.centerIn: parent
|
||||
|
||||
KeyHint {
|
||||
id: exitHintText
|
||||
x: root.theme.loopCardWidth / 2 - exitHintText.width
|
||||
y: root.theme.loopCardHeight / 2 + root.theme.hintGap
|
||||
// The old workspace, folding away.
|
||||
WindowRing {
|
||||
id: leavingRing
|
||||
y: root.leavingY + (leavingRing.flat ? 0 : root.theme.loopBackLift / 2)
|
||||
z: 0
|
||||
opacity: root.leavingFade
|
||||
visible: leavingRing.opacity > 0
|
||||
enabled: false
|
||||
compositor: root.compositor
|
||||
theme: root.theme
|
||||
hint: root.exitHint
|
||||
shown: root.count > 0
|
||||
windows: root.leavingWindows
|
||||
maxRadius: root.width * root.theme.loopMaxRadiusShare
|
||||
turn: root.leavingTurn
|
||||
selectedIndex: root.leavingIndex
|
||||
live: root.expanded
|
||||
// Its previews are already out, so they should not grow again.
|
||||
growPreview: false
|
||||
gather: root.leavingGather
|
||||
}
|
||||
|
||||
WindowRing {
|
||||
id: ring
|
||||
y: root.slideY + (ring.flat ? 0 : root.theme.loopBackLift / 2)
|
||||
z: 1
|
||||
opacity: root.switchFade
|
||||
enabled: root.expanded
|
||||
compositor: root.compositor
|
||||
theme: root.theme
|
||||
windows: root.windows
|
||||
maxRadius: root.width * root.theme.loopMaxRadiusShare
|
||||
turn: root.turn
|
||||
selectedIndex: root.selectedIndex
|
||||
live: root.expanded
|
||||
growPreview: true
|
||||
gather: root.gather
|
||||
|
||||
onActivated: index => root.activateAt(index)
|
||||
}
|
||||
|
||||
// Under the front window, or under the middle of a flat row,
|
||||
// above both rings.
|
||||
Item {
|
||||
y: ring.y
|
||||
z: 2
|
||||
opacity: root.switchFade
|
||||
|
||||
KeyHint {
|
||||
id: exitHintText
|
||||
x: ring.flat ? -exitHintText.width / 2 : root.theme.loopCardWidth / 2 - exitHintText.width
|
||||
y: root.theme.loopCardHeight / 2 + root.theme.hintGap
|
||||
theme: root.theme
|
||||
hint: root.exitHint
|
||||
shown: root.count > 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user