[apps] Add Shift + Ans shortcut to go to the last application

This commit is contained in:
Yaya.Cout
2022-03-30 21:34:54 +02:00
committed by Laury
parent 2bf6de5044
commit d42e4269a9
5 changed files with 42 additions and 0 deletions

View File

@@ -36,3 +36,18 @@ App::Snapshot * AppsContainerStorage::appSnapshotAtIndex(int index) {
assert(index >= 0 && index < k_numberOfCommonApps);
return snapshots[index];
}
// Get the index of the app from its snapshot
int AppsContainerStorage::appIndexFromSnapshot(App::Snapshot * snapshot) {
App::Snapshot * snapshots[] = {
homeAppSnapshot()
APPS_CONTAINER_SNAPSHOT_LIST
};
assert(sizeof(snapshots)/sizeof(snapshots[0]) == k_numberOfCommonApps);
for (int i = 0; i < k_numberOfCommonApps; i++) {
if (snapshots[i] == snapshot) {
return i;
}
}
return NULL;
}