@@ -24,7 +24,10 @@ struct ShiftKeyButton: View {
2424
2525 var body : some View {
2626 Button ( action: { self . isUpperCase? . toggle ( ) } ) {
27- if #available( iOS 14 , macOS 11 , * ) {
27+ if #available( iOS 15 , macOS 12 , * ) {
28+ AnyView ( Image ( systemName: isUpperCase ? " shift.fill " : " shift " )
29+ . dynamicTypeSize ( . large) )
30+ } else if #available( iOS 14 , macOS 11 , * ) {
2831 AnyView ( Image ( systemName: isUpperCase ? " shift.fill " : " shift " ) )
2932 } else {
3033 AnyView ( Text ( isUpperCase! ? " Up " : " lw " , bundle: . module) )
@@ -80,6 +83,7 @@ struct FRAccentKeyButton: View {
8083 . background ( Color . black. opacity ( 0.4 ) )
8184 . cornerRadius ( 5 )
8285 . layoutPriority ( 10 )
86+ . shadow ( color: . black, radius: 0 , y: 1 )
8387 }
8488 }
8589
@@ -108,16 +112,26 @@ struct SpaceKeyButton: View, ClickableKey {
108112 @Binding var text : String
109113 @Environment ( \. colorScheme) var colorScheme
110114
115+ var content : some View {
116+ let spaceText = Text ( " space " , bundle: . module)
117+ if #available( iOS 15 . 0 , macOS 12 , * ) {
118+ return AnyView ( spaceText. dynamicTypeSize ( . large) )
119+ } else {
120+ return AnyView ( spaceText)
121+ }
122+ }
123+
111124 var body : some View {
112125 Button ( action: { self . text. append ( " " ) ; didClick ( ) } ) {
113- Text ( " space " , bundle : . module )
126+ content
114127 . padding ( )
128+ . frame ( idealWidth: . infinity, maxWidth: . infinity)
115129 . frame ( height: 50 )
116130 . foregroundColor ( . primary)
117- . frame ( maxWidth: . infinity)
118131 . background ( colorScheme. keyboardKeyColor)
119132 . cornerRadius ( 7 )
120133 . layoutPriority ( 2 )
134+ . shadow ( color: . black, radius: 1 , y: 1 )
121135 }
122136 }
123137}
@@ -130,7 +144,9 @@ struct DeleteKeyButton: View {
130144 guard !self . text. isEmpty else { return }
131145 _ = self . text. removeLast ( )
132146 } ) {
133- if #available( iOS 14 , macOS 11 , * ) {
147+ if #available( iOS 15 , macOS 12 , * ) {
148+ AnyView ( Image ( systemName: " delete.left " ) . dynamicTypeSize ( . large) )
149+ } else if #available( iOS 14 , macOS 11 , * ) {
134150 AnyView ( Image ( systemName: " delete.left " ) )
135151 } else {
136152 AnyView ( Text ( " ⌫ " ) )
@@ -153,13 +169,24 @@ struct ActionKeyButton: View {
153169 @State var icon : Icon
154170 var action : ( ) -> Void
155171
172+ var iconView : some View {
173+ if #available( iOS 15 . 0 , macOS 12 , * ) {
174+ return AnyView ( icon. view. dynamicTypeSize ( . large) )
175+ } else {
176+ return icon. view
177+ }
178+ }
179+
156180 var body : some View {
157181 Button ( action: self . action) {
158- icon. view. padding ( )
182+ iconView
183+ . padding ( )
184+ . frame ( minWidth: 100 , maxWidth: . infinity)
159185 . frame ( height: 50 )
160186 . foregroundColor ( . white)
161- . frame ( minWidth: 100 , idealWidth: . infinity, maxWidth: . infinity)
162- . background ( Color . blue) . cornerRadius ( 7 )
187+ . background ( Color . blue)
188+ . cornerRadius ( 7 )
189+ . shadow ( color: . black, radius: 2 , y: 2 )
163190 }
164191 }
165192}
@@ -171,11 +198,11 @@ public enum Icon {
171198 switch self {
172199 case . done: return AnyView ( Text ( " Done! " , bundle: . module) )
173200 case . search:
174- # if !targetEnvironment(macCatalyst)
175- return AnyView ( Text ( " Search " , bundle : . module ) )
176- # else
177- return AnyView ( Image ( systemName : " magnifyingglass " ) )
178- #endif
201+ if #available ( iOS 14 , macOS 11 , * ) {
202+ return AnyView ( Image ( systemName : " magnifyingglass " ) )
203+ } else {
204+ return AnyView ( Text ( " Search " , bundle : . module ) )
205+ }
179206 case . go: return AnyView ( Text ( " Go! " , bundle: . module) )
180207 }
181208 }
0 commit comments