homescreen: Ensure signal is listened to for closing startup feedback on error

This commit is contained in:
Devin Lin 2022-03-20 14:24:44 -04:00
parent 7e47315bcb
commit 529f42296a
8 changed files with 19 additions and 8 deletions

View file

@ -66,6 +66,12 @@ Item {
width: flickContainer.width width: flickContainer.width
height: flickContainer.height height: flickContainer.height
// listen to app launch errors
Connections {
target: HomeScreenComponents.ApplicationListModel
onLaunchError: MobileShell.HomeScreenControls.closeAppLaunchAnimation()
}
// horizontal pages // horizontal pages
HomeScreenPages { HomeScreenPages {
id: pages id: pages

View file

@ -106,7 +106,7 @@ Repeater {
onLaunch: (x, y, icon, title) => { onLaunch: (x, y, icon, title) => {
if (icon !== "") { if (icon !== "") {
print(delegate.iconItem) print(delegate.iconItem)
MobileShell.HomeScreenControls.openAppAnimation( MobileShell.HomeScreenControls.openAppLaunchAnimation(
icon, icon,
title, title,
delegate.iconItem.Kirigami.ScenePosition.x + delegate.iconItem.width/2, delegate.iconItem.Kirigami.ScenePosition.x + delegate.iconItem.width/2,

View file

@ -60,7 +60,7 @@ AbstractAppDrawer {
} }
onLaunch: (x, y, icon, title, storageId) => { onLaunch: (x, y, icon, title, storageId) => {
if (icon !== "") { if (icon !== "") {
MobileShell.HomeScreenControls.openAppAnimation( MobileShell.HomeScreenControls.openAppLaunchAnimation(
icon, icon,
title, title,
delegate.iconItem.Kirigami.ScenePosition.x + delegate.iconItem.width/2, delegate.iconItem.Kirigami.ScenePosition.x + delegate.iconItem.width/2,

View file

@ -57,7 +57,7 @@ AbstractAppDrawer {
} }
onLaunch: (x, y, icon, title, storageId) => { onLaunch: (x, y, icon, title, storageId) => {
if (icon !== "") { if (icon !== "") {
MobileShell.HomeScreenControls.openAppAnimation( MobileShell.HomeScreenControls.openAppLaunchAnimation(
icon, icon,
title, title,
delegate.iconItem.Kirigami.ScenePosition.x + delegate.iconItem.width/2, delegate.iconItem.Kirigami.ScenePosition.x + delegate.iconItem.width/2,

View file

@ -69,9 +69,13 @@ FocusScope {
//lastRequestedPosition = pos.y; //lastRequestedPosition = pos.y;
} }
function onOpenAppAnimation(splashIcon, title, x, y, sourceIconSize) { function onOpenAppLaunchAnimation(splashIcon, title, x, y, sourceIconSize) {
startupFeedback.open(splashIcon, title, x, y, sourceIconSize); startupFeedback.open(splashIcon, title, x, y, sourceIconSize);
} }
function onCloseAppLaunchAnimation() {
startupFeedback.close();
}
} }
Plasmoid.onScreenChanged: { Plasmoid.onScreenChanged: {

View file

@ -21,7 +21,8 @@ QtObject {
signal snapHomeScreenPosition() signal snapHomeScreenPosition()
signal requestRelativeScroll(point pos) signal requestRelativeScroll(point pos)
signal openAppAnimation(string splashIcon, string title, real x, real y, real sourceIconSize) signal openAppLaunchAnimation(string splashIcon, string title, real x, real y, real sourceIconSize)
signal closeAppLaunchAnimation()
property var taskSwitcher property var taskSwitcher
property QtObject homeScreenWindow property QtObject homeScreenWindow

View file

@ -47,7 +47,7 @@ Components.BaseItem {
root.toggleFunction(); root.toggleFunction();
} else if (root.settingsCommand) { } else if (root.settingsCommand) {
closeRequested(); closeRequested();
MobileShell.HomeScreenControls.openAppAnimation( MobileShell.HomeScreenControls.openAppLaunchAnimation(
root.icon, root.icon,
root.text, root.text,
iconItem.Kirigami.ScenePosition.x + iconItem.width/2, iconItem.Kirigami.ScenePosition.x + iconItem.width/2,
@ -60,7 +60,7 @@ Components.BaseItem {
function delegatePressAndHold() { function delegatePressAndHold() {
if (root.settingsCommand) { if (root.settingsCommand) {
closeRequested(); closeRequested();
MobileShell.HomeScreenControls.openAppAnimation( MobileShell.HomeScreenControls.openAppLaunchAnimation(
root.icon, root.icon,
root.text, root.text,
iconItem.Kirigami.ScenePosition.x + iconItem.width/2, iconItem.Kirigami.ScenePosition.x + iconItem.width/2,

View file

@ -171,7 +171,7 @@ NanoShell.FullScreenOverlay {
onClicked: { onClicked: {
let coords = mapToItem(flickable, 0, 0); let coords = mapToItem(flickable, 0, 0);
MobileShell.HomeScreenControls.openAppAnimation("audio-volume-high", i18n("Audio Settings"), coords.x, coords.y, PlasmaCore.Units.iconSizes.medium); MobileShell.HomeScreenControls.openAppLaunchAnimation("audio-volume-high", i18n("Audio Settings"), coords.x, coords.y, PlasmaCore.Units.iconSizes.medium);
plasmoid.nativeInterface.executeCommand("plasma-open-settings kcm_pulseaudio"); plasmoid.nativeInterface.executeCommand("plasma-open-settings kcm_pulseaudio");
} }
} }