File tree Expand file tree Collapse file tree 2 files changed +22
-11
lines changed
Sources/swiftui-search-field-shell-line Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ public struct SearchFieldShell: View {
206206
207207}
208208
209+ #if DEBUG
209210struct SearchField_Previews : PreviewProvider {
210211 static var previews : some View {
211212 GeometryReader { proxy in
@@ -217,12 +218,4 @@ struct SearchField_Previews: PreviewProvider {
217218
218219 }
219220}
220-
221- #if os(OSX)
222- extension NSTextField {
223- override open var focusRingType : NSFocusRingType {
224- get { . none }
225- set { }
226- }
227- }
228221#endif
Original file line number Diff line number Diff line change 88import SwiftUI
99
1010/// Line with animation of lenght
11+ /// Utility component for ``SearchFieldShell``
1112struct SearchFieldShellLine : Shape {
1213
1314 /// Lines thickness
@@ -21,13 +22,20 @@ struct SearchFieldShellLine: Shape {
2122 }
2223
2324 // MARK: - Config
24-
25+
26+ /// Available width size for component
2527 let width : Double
2628
29+ /// Available height size for component
2730 let height : CGFloat
28-
31+
32+ /// Animatable variable for animatiing line length
2933 var x : Double = 0
3034
35+
36+ /// Create line for ``SearchFieldShell``
37+ /// - Parameter rect: Rect space
38+ /// - Returns: Line
3139 func path( in rect: CGRect ) -> Path {
3240 let delta = self . height / 2
3341 let y = self . height
@@ -37,9 +45,19 @@ struct SearchFieldShellLine: Shape {
3745 }
3846 }
3947}
40-
48+ #if DEBUG
4149struct SearchFieldShellLine_Previews : PreviewProvider {
4250 static var previews : some View {
4351 SearchFieldShellLine ( width: . zero, height: 75 , x: . zero)
4452 }
4553}
54+ #endif
55+
56+ #if os(OSX)
57+ extension NSTextField {
58+ override open var focusRingType : NSFocusRingType {
59+ get { . none }
60+ set { }
61+ }
62+ }
63+ #endif
You can’t perform that action at this time.
0 commit comments