Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Loop Widget Extension/Helpers/ContentMargin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// ContentMargin.swift
// Loop Widget Extension
//
// Created by Cameron Ingham on 9/29/23.
// Copyright © 2023 LoopKit Authors. All rights reserved.
//

import SwiftUI
import WidgetKit

extension WidgetConfiguration {
func contentMarginsDisabledIfAvailable() -> some WidgetConfiguration {
if #available(iOSApplicationExtension 17.0, *) {
return self.contentMarginsDisabled()
} else {
return self
}
}
}
8 changes: 7 additions & 1 deletion Loop Widget Extension/Helpers/WidgetBackground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import SwiftUI
extension View {
@ViewBuilder
func widgetBackground() -> some View {
self.background { Color("WidgetBackground") }
if #available(iOSApplicationExtension 17.0, *) {
self.containerBackground(for: .widget) {
Color("WidgetBackground")
}
} else {
self.background { Color("WidgetBackground") }
}
}
}
1 change: 1 addition & 0 deletions Loop Widget Extension/Widgets/SystemStatusWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@ struct SystemStatusWidget: Widget {
.configurationDisplayName("Loop Status Widget")
.description("See your current blood glucose and insulin delivery.")
.supportedFamilies([.systemSmall, .systemMedium])
.contentMarginsDisabledIfAvailable()
}
}
4 changes: 4 additions & 0 deletions Loop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
84AA81E32A4A36FB000B658B /* SystemActionLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AA81E22A4A36FB000B658B /* SystemActionLink.swift */; };
84AA81E52A4A3981000B658B /* DeeplinkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AA81E42A4A3981000B658B /* DeeplinkManager.swift */; };
84AA81E72A4A4DEF000B658B /* PumpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AA81E62A4A4DEF000B658B /* PumpView.swift */; };
84D2879F2AC756C8007ED283 /* ContentMargin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D2879E2AC756C8007ED283 /* ContentMargin.swift */; };
891B508524342BE1005DA578 /* CarbAndBolusFlowViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891B508424342BE1005DA578 /* CarbAndBolusFlowViewModel.swift */; };
892A5D59222F0A27008961AB /* Debug.swift in Sources */ = {isa = PBXBuildFile; fileRef = 892A5D58222F0A27008961AB /* Debug.swift */; };
892A5D692230C41D008961AB /* RangeReplaceableCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 892A5D682230C41D008961AB /* RangeReplaceableCollection.swift */; };
Expand Down Expand Up @@ -1182,6 +1183,7 @@
84AA81E22A4A36FB000B658B /* SystemActionLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemActionLink.swift; sourceTree = "<group>"; };
84AA81E42A4A3981000B658B /* DeeplinkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeeplinkManager.swift; sourceTree = "<group>"; };
84AA81E62A4A4DEF000B658B /* PumpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PumpView.swift; sourceTree = "<group>"; };
84D2879E2AC756C8007ED283 /* ContentMargin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentMargin.swift; sourceTree = "<group>"; };
891B508424342BE1005DA578 /* CarbAndBolusFlowViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarbAndBolusFlowViewModel.swift; sourceTree = "<group>"; };
892A5D29222EF60A008961AB /* MockKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = MockKit.framework; path = Carthage/Build/iOS/MockKit.framework; sourceTree = SOURCE_ROOT; };
892A5D2B222EF60A008961AB /* MockKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = MockKitUI.framework; path = Carthage/Build/iOS/MockKitUI.framework; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -2532,6 +2534,7 @@
children = (
84AA81DA2A4A2973000B658B /* Date.swift */,
84AA81D52A4A28AF000B658B /* WidgetBackground.swift */,
84D2879E2AC756C8007ED283 /* ContentMargin.swift */,
);
path = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -3640,6 +3643,7 @@
14B1737328AEDBF6006CCD7C /* SystemStatusWidget.swift in Sources */,
84AA81DD2A4A2999000B658B /* StatusWidgetTimelineProvider.swift in Sources */,
14B1737528AEDBF6006CCD7C /* LoopCircleView.swift in Sources */,
84D2879F2AC756C8007ED283 /* ContentMargin.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down