File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Sources/W3WSwiftComponentsOcr/Presenters/Ocr/Views/Modifiers Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 88import SwiftUI
99import W3WSwiftThemes
1010import W3WSwiftDesignSwiftUI
11+ import W3WSwiftAppTypes
1112
1213
1314/// styling the SwiftUI toggle
@@ -51,14 +52,14 @@ struct BorderedSwitchToggleStyle: ToggleStyle {
5152 . padding ( 4 )
5253 . frame ( maxWidth: . infinity, alignment: configuration. isOn ? . trailing : . leading)
5354
54- if isLocked {
55+ if isLocked, !W3WAppConstants . padlockConfig . isHidden {
5556 W3WIconImage (
5657 iconImage: . w3wLock,
5758 iconSize: 12 ,
58- color: W3WCoreColor . white . suColor
59+ color: W3WAppConstants . padlockConfig . foregroundColor . suColor
5960 )
6061 . frame ( width: 14 , height: 14 )
61- . background ( W3WTheme . what3words . brandBase ? . suColor)
62+ . background ( W3WAppConstants . padlockConfig . backgroundColor . suColor)
6263 . clipShape ( . circle)
6364 . offset ( x: 23.0 , y: - 13.0 )
6465 }
Original file line number Diff line number Diff line change 88import SwiftUI
99import W3WSwiftThemes
1010import W3WSwiftDesignSwiftUI
11+ import W3WSwiftAppTypes
1112
1213
1314// hack to copy lock funtionality, the original is in
@@ -21,23 +22,22 @@ public extension View {
2122 _ value: Bool ,
2223 alignment: Alignment = . topTrailing,
2324 offsetX: CGFloat = 0 ,
24- offsetY: CGFloat = 0 ,
25- lockColor: Color = . white
25+ offsetY: CGFloat = 0
2626 ) -> some View {
27- self . cornerOverlay (
28- isVisible: value,
27+ let isLockVisible = value && !W3WAppConstants. padlockConfig. isHidden
28+ return self . cornerOverlay (
29+ isVisible: isLockVisible,
2930 alignment: alignment,
3031 offsetX: offsetX,
3132 offsetY: offsetY,
3233 overlayView: {
33- // TODO: Add lock images when ready
3434 W3WIconImage (
3535 iconImage: . w3wLock,
3636 iconSize: 12 ,
37- color: lockColor
37+ color: W3WAppConstants . padlockConfig . foregroundColor . suColor
3838 )
3939 . frame ( width: 14 , height: 14 )
40- . background ( W3WTheme . what3words . brandBase ? . suColor)
40+ . background ( W3WAppConstants . padlockConfig . backgroundColor . suColor)
4141 . clipShape ( . circle)
4242 } )
4343 }
You can’t perform that action at this time.
0 commit comments