mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-26 06:14:45 +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 {
|
DragHandler {
|
||||||
id: dragHandler
|
id: dragHandler
|
||||||
target: parent
|
target: parent
|
||||||
|
|
||||||
yAxis.enabled: true
|
yAxis.enabled: true
|
||||||
xAxis.enabled: false
|
xAxis.enabled: false
|
||||||
yAxis.maximum: 0
|
yAxis.maximum: 0
|
||||||
|
|
||||||
|
// y > 0 - dragging down (opening the app)
|
||||||
|
// y < 0 - dragging up (dismissing the app)
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
yAnimator.stop();
|
yAnimator.stop();
|
||||||
|
|
||||||
|
|
@ -194,16 +198,18 @@ Item {
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
id: item
|
id: item
|
||||||
|
|
||||||
|
// app icon (behind window preview in-case it doesn't load)
|
||||||
|
TaskIcon {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
// attempt to load window preview
|
||||||
Loader {
|
Loader {
|
||||||
id: pipeWireLoader
|
id: pipeWireLoader
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: Qt.resolvedUrl("./Thumbnail.qml")
|
source: Qt.resolvedUrl("./Thumbnail.qml")
|
||||||
onStatusChanged: {
|
|
||||||
if (status === Loader.Error) {
|
|
||||||
source = Qt.resolvedUrl("./TaskIcon.qml");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
onTapped: delegate.activateApp()
|
onTapped: delegate.activateApp()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ import QtQuick.Layouts 1.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
PlasmaCore.IconItem {
|
||||||
implicitWidth: PlasmaCore.Units.iconSizes.medium
|
implicitWidth: PlasmaCore.Units.iconSizes.enormous
|
||||||
implicitHeight: PlasmaCore.Units.iconSizes.medium
|
implicitHeight: PlasmaCore.Units.iconSizes.enormous
|
||||||
usesPlasmaTheme: false
|
usesPlasmaTheme: false
|
||||||
source: model.decoration
|
source: model.decoration
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,19 +164,11 @@ Item {
|
||||||
taskSwitcherState: root.taskSwitcherState
|
taskSwitcherState: root.taskSwitcherState
|
||||||
|
|
||||||
// the item is effectively anchored to the flickable bounds
|
// the item is effectively anchored to the flickable bounds
|
||||||
QQC2.Control {
|
TaskList {
|
||||||
leftPadding: 0
|
taskSwitcher: root
|
||||||
rightPadding: 0
|
|
||||||
topPadding: 0
|
|
||||||
bottomPadding: 0
|
|
||||||
|
|
||||||
x: flickable.contentX
|
x: flickable.contentX
|
||||||
width: flickable.width
|
width: flickable.width
|
||||||
height: flickable.height
|
height: flickable.height
|
||||||
|
|
||||||
contentItem: TaskList {
|
|
||||||
taskSwitcher: root
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue