mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 22:53:09 +00:00
add icon list to task scrub mode
This commit is contained in:
parent
7a453425fc
commit
fddf5e9f31
2 changed files with 48 additions and 14 deletions
|
|
@ -17,7 +17,6 @@ Item {
|
||||||
required property var taskSwitcher
|
required property var taskSwitcher
|
||||||
|
|
||||||
required property QtObject window
|
required property QtObject window
|
||||||
required property int index
|
|
||||||
|
|
||||||
required property var model
|
required property var model
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -430,6 +430,51 @@ FocusScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: scrubIconList
|
||||||
|
opacity: taskSwitcherHelpers.isInTaskScrubMode ? 1 : 0
|
||||||
|
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration } }
|
||||||
|
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.bottomMargin: taskSwitcherHelpers.openedYPosition * 5 / 8
|
||||||
|
|
||||||
|
anchors.horizontalCenterOffset: {
|
||||||
|
let size = Kirigami.Units.iconSizes.large + Kirigami.Units.largeSpacing * 2;
|
||||||
|
let offset = (root.state.currentTaskIndex - 0.5) * size;
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
Behavior on anchors.horizontalCenterOffset {
|
||||||
|
NumberAnimation {
|
||||||
|
// TODO: this duration should track the duration of xAnim but that is variable through function parameter
|
||||||
|
// how do we make sure this is always the same duration?
|
||||||
|
duration: Kirigami.Units.longDuration * 2;
|
||||||
|
easing.type: Easing.OutBack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spacing: Kirigami.Units.largeSpacing * 2
|
||||||
|
|
||||||
|
layoutDirection: Qt.RightToLeft
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: root.tasksModel
|
||||||
|
|
||||||
|
delegate: Kirigami.Icon {
|
||||||
|
id: iconDelegate
|
||||||
|
|
||||||
|
required property QtObject window
|
||||||
|
required property int index
|
||||||
|
|
||||||
|
readonly property bool isCenteredIcon: iconDelegate.index === root.state.currentTaskIndex;
|
||||||
|
Layout.preferredHeight: isCenteredIcon ? Kirigami.Units.iconSizes.huge : Kirigami.Units.iconSizes.large
|
||||||
|
Layout.preferredWidth: isCenteredIcon ? Kirigami.Units.iconSizes.huge : Kirigami.Units.iconSizes.large
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
source: iconDelegate.window.icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: scrubIndicator
|
id: scrubIndicator
|
||||||
opacity: taskSwitcherHelpers.isInTaskScrubMode ? 1 : 0
|
opacity: taskSwitcherHelpers.isInTaskScrubMode ? 1 : 0
|
||||||
|
|
@ -442,7 +487,7 @@ FocusScope {
|
||||||
Kirigami.Icon {
|
Kirigami.Icon {
|
||||||
id: iconScrubBack
|
id: iconScrubBack
|
||||||
opacity: root.state.currentTaskIndex == 0 ? 0.3 : 1
|
opacity: root.state.currentTaskIndex == 0 ? 0.3 : 1
|
||||||
Behavior on opacity { NumberAnimation { duration: 200} }
|
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration * 2; easing.type: Easing.OutExpo } }
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
implicitWidth: Kirigami.Units.iconSizes.medium
|
implicitWidth: Kirigami.Units.iconSizes.medium
|
||||||
implicitHeight: Kirigami.Units.iconSizes.medium
|
implicitHeight: Kirigami.Units.iconSizes.medium
|
||||||
|
|
@ -450,16 +495,6 @@ FocusScope {
|
||||||
color: "white"
|
color: "white"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Kirigami.Heading {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.maximumWidth: root.width * 0.75
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
color: "white"
|
|
||||||
level: 3
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
text: i18n("Swipe")
|
|
||||||
}*/
|
|
||||||
Item {
|
Item {
|
||||||
width: taskSwitcherHelpers.windowWidth / 4
|
width: taskSwitcherHelpers.windowWidth / 4
|
||||||
}
|
}
|
||||||
|
|
@ -467,7 +502,7 @@ FocusScope {
|
||||||
Kirigami.Icon {
|
Kirigami.Icon {
|
||||||
id: iconScrubFront
|
id: iconScrubFront
|
||||||
opacity: root.state.currentTaskIndex == tasksCount - 1 ? 0.3 : 1
|
opacity: root.state.currentTaskIndex == tasksCount - 1 ? 0.3 : 1
|
||||||
Behavior on opacity { NumberAnimation { duration: 200} }
|
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration * 2; easing.type: Easing.OutExpo } }
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
implicitWidth: Kirigami.Units.iconSizes.medium
|
implicitWidth: Kirigami.Units.iconSizes.medium
|
||||||
implicitHeight: Kirigami.Units.iconSizes.medium
|
implicitHeight: Kirigami.Units.iconSizes.medium
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue