File tree Expand file tree Collapse file tree 7 files changed +31
-12
lines changed
Shared/Resources/Swiftgen Expand file tree Collapse file tree 7 files changed +31
-12
lines changed Original file line number Diff line number Diff line change @@ -1129,6 +1129,7 @@ Home Assistant is free and open source home automation software with a focus on
11291129"widgets.custom.show_update_time.title" = "Last update:";
11301130"widgets.custom.subtitle" = "Create widgets with your own style";
11311131"widgets.custom.title" = "Custom widgets";
1132+ "widgets.custom.require_confirmation.footer" = "Widget confirmation and state display are currently in BETA, if you experience issues please disable 'Require confirmation' and save.";
11321133"widgets.details.description" = "Display states using from Home Assistant in text";
11331134"widgets.details.description_with_warning" = "Display states using from Home Assistant in text. ATTENTION: User needs to be admin for templating access";
11341135"widgets.details.parameters.action" = "Action";
@@ -1169,4 +1170,4 @@ Home Assistant is free and open source home automation software with a focus on
11691170"widgets.sensors.description" = "Display state of sensors";
11701171"widgets.sensors.not_configured" = "No Sensors Configured";
11711172"widgets.sensors.title" = "Sensors";
1172- "yes_label" = "Yes";
1173+ "yes_label" = "Yes";
Original file line number Diff line number Diff line change @@ -27,10 +27,10 @@ struct DebugView: View {
2727 var body : some View {
2828 List {
2929 AppleLikeListTopRowHeader (
30- image: . init ( uiImage: MaterialDesignIcons . bugIcon. image (
30+ image: AnyView ( Image ( uiImage: MaterialDesignIcons . bugIcon. image (
3131 ofSize: . init( width: 120 , height: 120 ) ,
3232 color: Asset . Colors. haPrimary. color
33- ) ) ,
33+ ) ) ) ,
3434 title: L10n . Settings. Debugging. Header. title,
3535 subtitle: L10n . Settings. Debugging. Header. subtitle
3636 )
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Shared
22import SwiftUI
33
44struct AppleLikeListTopRowHeader : View {
5- let image : Image
5+ let image : AnyView
66 let title : String
77 let subtitle : String
88
@@ -24,7 +24,7 @@ struct AppleLikeListTopRowHeader: View {
2424
2525#Preview {
2626 AppleLikeListTopRowHeader (
27- image: Image ( imageAsset: Asset . SharedAssets. casita) ,
27+ image: AnyView ( Image ( imageAsset: Asset . SharedAssets. casita) ) ,
2828 title: " Settings " ,
2929 subtitle: " This is a text that represents the body "
3030 )
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ struct GesturesSetupView: View {
77 var body : some View {
88 List {
99 AppleLikeListTopRowHeader (
10- image: Image ( uiImage: MaterialDesignIcons . gestureIcon. image (
10+ image: AnyView ( Image ( uiImage: MaterialDesignIcons . gestureIcon. image (
1111 ofSize: . init( width: 80 , height: 80 ) ,
1212 color: Asset . Colors. haPrimary. color
13- ) ) ,
13+ ) ) ) ,
1414 title: L10n . Gestures. Screen. title,
1515 subtitle: L10n . Gestures. Screen. body
1616 )
Original file line number Diff line number Diff line change @@ -219,13 +219,16 @@ struct MagicItemCustomizationView: View {
219219 scriptActionDetails
220220 }
221221 }
222-
223222 Section {
224223 Toggle ( L10n . MagicItem. RequireConfirmation. title, isOn: . init( get: {
225224 viewModel. item. customization? . requiresConfirmation ?? true
226225 } , set: { newValue in
227226 viewModel. item. customization? . requiresConfirmation = newValue
228227 } ) )
228+ } footer: {
229+ if context == . widget {
230+ Text ( L10n . Widgets. Custom. RequireConfirmation. footer)
231+ }
229232 }
230233 }
231234
Original file line number Diff line number Diff line change @@ -48,10 +48,21 @@ struct WidgetBuilderView: View {
4848
4949 private var header : some View {
5050 AppleLikeListTopRowHeader (
51- image: Image ( uiImage: MaterialDesignIcons . widgetsIcon. image (
52- ofSize: . init( width: 80 , height: 80 ) ,
53- color: Asset . Colors. haPrimary. color
54- ) ) ,
51+ image: AnyView (
52+ ZStack ( alignment: . topTrailing) {
53+ Image ( uiImage: MaterialDesignIcons . widgetsIcon. image (
54+ ofSize: . init( width: 80 , height: 80 ) ,
55+ color: Asset . Colors. haPrimary. color
56+ ) )
57+ Text ( " BETA " )
58+ . font ( . caption)
59+ . padding ( . horizontal, Spaces . one)
60+ . padding ( . vertical, Spaces . half)
61+ . background ( . regularMaterial)
62+ . clipShape ( Capsule ( ) )
63+ . offset ( x: Spaces . oneAndHalf, y: 0 )
64+ }
65+ ) ,
5566 title: L10n . Widgets. Custom. title,
5667 subtitle: L10n . Widgets. Custom. subtitle
5768 )
Original file line number Diff line number Diff line change @@ -3956,6 +3956,10 @@ public enum L10n {
39563956 /// Failed to 'toggle' entity
39573957 public static var title : String { return L10n . tr ( " Localizable " , " widgets.custom.intent_toggle_failed.title " ) }
39583958 }
3959+ public enum RequireConfirmation {
3960+ /// Widget confirmation and state display are currently in BETA, if you experience issues please disable 'Require confirmation' and save.
3961+ public static var footer : String { return L10n . tr ( " Localizable " , " widgets.custom.require_confirmation.footer " ) }
3962+ }
39593963 public enum ShowUpdateTime {
39603964 /// Last update:
39613965 public static var title : String { return L10n . tr ( " Localizable " , " widgets.custom.show_update_time.title " ) }
You can’t perform that action at this time.
0 commit comments