|
|
@@ -246,7 +246,7 @@ struct LauncherRootView: View {
|
|
|
IconPanelView(
|
|
|
apps: filteredApps,
|
|
|
onAppTap: { app in
|
|
|
- handleAppTap(app)
|
|
|
+ handlePanelAppTap(app)
|
|
|
},
|
|
|
draggedAppID: $draggedAppID,
|
|
|
lastDropDestinationAppID: $lastDropDestinationAppID,
|
|
|
@@ -300,6 +300,26 @@ struct LauncherRootView: View {
|
|
|
selectedApp = app
|
|
|
}
|
|
|
|
|
|
+ /// Second (panel) view: tapping a row opens the Widgets window for that app.
|
|
|
+ private func handlePanelAppTap(_ app: LauncherApp) {
|
|
|
+ if app.isCreateNew {
|
|
|
+ showingCreateAppSheet = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ openWidgetsPage(for: app)
|
|
|
+ }
|
|
|
+
|
|
|
+ private func openWidgetsPage(for app: LauncherApp) {
|
|
|
+ var updated = decodeUUIDSetGlobal(from: widgetAppIDsData)
|
|
|
+ updated.insert(app.id)
|
|
|
+ widgetAppIDsData = encodeUUIDSetGlobal(updated)
|
|
|
+ NotificationCenter.default.post(
|
|
|
+ name: .openWidgetsPage,
|
|
|
+ object: nil,
|
|
|
+ userInfo: ["appID": app.id]
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
private func addCustomApp(name: String, url: URL) {
|
|
|
let newApp = LauncherApp(
|
|
|
name: name,
|