mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Widgets-Fix: Ported Widget compatibility for ios 18+ from altstore (#746)
This commit is contained in:
@@ -82,6 +82,7 @@ struct ComplicationView: View
|
||||
}
|
||||
.gaugeStyle(.accessoryCircularCapacity)
|
||||
.unredacted()
|
||||
.widgetBackground(Color.clear)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
27
AltWidget/Extensions/View+AltWidget.swift
Normal file
27
AltWidget/Extensions/View+AltWidget.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// View+AltWidget.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 8/18/23.
|
||||
// Copyright © 2023 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
extension View
|
||||
{
|
||||
@ViewBuilder
|
||||
func widgetBackground(_ backgroundView: some View) -> some View
|
||||
{
|
||||
if #available(iOSApplicationExtension 17, *)
|
||||
{
|
||||
containerBackground(for: .widget) {
|
||||
backgroundView
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
background(backgroundView)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,8 @@ struct WidgetView : View
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
.background(backgroundView(icon: entry.app?.icon, tintColor: entry.app?.tintColor))
|
||||
.widgetBackground(backgroundView(icon: entry.app?.icon, tintColor: entry.app?.tintColor))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user