taskswitcher: Add icon behind thumbnail preview in case it doesn't load

This commit is contained in:
Devin Lin 2021-12-27 13:07:34 -05:00
parent 2f27eb848d
commit a75349f93e
3 changed files with 15 additions and 17 deletions

View file

@ -76,9 +76,13 @@ Item {
DragHandler {
id: dragHandler
target: parent
yAxis.enabled: true
xAxis.enabled: false
yAxis.maximum: 0
// y > 0 - dragging down (opening the app)
// y < 0 - dragging up (dismissing the app)
onActiveChanged: {
yAnimator.stop();
@ -194,16 +198,18 @@ Item {
contentItem: Item {
id: item
// app icon (behind window preview in-case it doesn't load)
TaskIcon {
anchors.centerIn: parent
}
// attempt to load window preview
Loader {
id: pipeWireLoader
anchors.fill: parent
source: Qt.resolvedUrl("./Thumbnail.qml")
onStatusChanged: {
if (status === Loader.Error) {
source = Qt.resolvedUrl("./TaskIcon.qml");
}
}
}
TapHandler {
onTapped: delegate.activateApp()
}

View file

@ -10,8 +10,8 @@ import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
PlasmaCore.IconItem {
implicitWidth: PlasmaCore.Units.iconSizes.medium
implicitHeight: PlasmaCore.Units.iconSizes.medium
implicitWidth: PlasmaCore.Units.iconSizes.enormous
implicitHeight: PlasmaCore.Units.iconSizes.enormous
usesPlasmaTheme: false
source: model.decoration
}

View file

@ -164,19 +164,11 @@ Item {
taskSwitcherState: root.taskSwitcherState
// the item is effectively anchored to the flickable bounds
QQC2.Control {
leftPadding: 0
rightPadding: 0
topPadding: 0
bottomPadding: 0
TaskList {
taskSwitcher: root
x: flickable.contentX
width: flickable.width
height: flickable.height
contentItem: TaskList {
taskSwitcher: root
}
}
}
}