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
height: flickContainer.height
// listen to app launch errors
Connections {
target: HomeScreenComponents.ApplicationListModel
onLaunchError: MobileShell.HomeScreenControls.closeAppLaunchAnimation()
}
// horizontal pages
HomeScreenPages {
id: pages

View file

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

View file

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

View file

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

View file

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

View file

@ -21,7 +21,8 @@ QtObject {
signal snapHomeScreenPosition()
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 QtObject homeScreenWindow

View file

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

View file

@ -171,7 +171,7 @@ NanoShell.FullScreenOverlay {
onClicked: {
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");
}
}