mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
[AltWidget] Supports refreshing apps directly from home screen
This commit is contained in:
@@ -24,4 +24,33 @@ extension View
|
||||
background(backgroundView)
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
func invalidatableContentIfAvailable() -> some View
|
||||
{
|
||||
if #available(iOSApplicationExtension 17, *)
|
||||
{
|
||||
self.invalidatableContent()
|
||||
}
|
||||
else
|
||||
{
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
func activatesRefreshAllAppsIntent() -> some View
|
||||
{
|
||||
if #available(iOSApplicationExtension 17, *)
|
||||
{
|
||||
Button(intent: RefreshAllAppsWidgetIntent()) {
|
||||
self
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
else
|
||||
{
|
||||
self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,9 +80,11 @@ struct WidgetView : View
|
||||
.opacity(0.8)
|
||||
.fixedSize(horizontal: true, vertical: false)
|
||||
.offset(x: 5)
|
||||
.invalidatableContentIfAvailable()
|
||||
}
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.activatesRefreshAllAppsIntent()
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user