mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
taskswitcher: Add icon behind thumbnail preview in case it doesn't load
This commit is contained in:
parent
2f27eb848d
commit
a75349f93e
3 changed files with 15 additions and 17 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue