@@ -73,40 +73,37 @@ struct SettingsView: View {
7373 Text ( " \( viewMode. rawValue. capitalized) s before: " ) . frame ( width: 90 , alignment: . trailing)
7474 HStack {
7575 HStack ( spacing: 0 ) {
76- Text ( String ( daysBefore) )
77- // TextField("", value: $daysBefore, format: .number)
78- // .textFieldStyle(RoundedBorderTextFieldStyle())
79- // .disableAutocorrection(true)
80- // .textContentType(.password)
81- // .frame(width: 40)
82- // .frame(alignment: .center)
83- // .multilineTextAlignment(.trailing)
84- // .focusable(false)
85- // .disabled(true)
8676
87- Stepper ( " " , onIncrement: {
88- if viewMode == . week && daysBefore < 50 {
89- daysBefore += 5
90- } else if viewMode == . day && daysBefore < 10 {
91- daysBefore += 1
92- }
93- } , onDecrement: {
94- if viewMode == . week && daysBefore > 0 {
95- daysBefore -= 5
96- } else if viewMode == . day && daysBefore > 0 {
97- daysBefore -= 1
98- } } )
77+ HStack {
78+ Text ( String ( daysBefore) )
79+ . frame ( width: 50 , height: 20 , alignment: . center)
80+ . overlay {
81+ HStack {
82+ Spacer ( )
83+
84+ Stepper ( " " , onIncrement: {
85+ if viewMode == . week && daysBefore < 50 {
86+ daysBefore += 5
87+ } else if viewMode == . day && daysBefore < 10 {
88+ daysBefore += 1
89+ }
90+ } , onDecrement: {
91+ if viewMode == . week && daysBefore > 0 {
92+ daysBefore -= 5
93+ } else if viewMode == . day && daysBefore > 0 {
94+ daysBefore -= 1
95+ }
96+ } )
97+ }
98+ }
99+ . overlay (
100+ RoundedRectangle ( cornerRadius: 4 )
101+ . stroke ( Color ( nsColor: NSColor . controlColor) , lineWidth: 1 )
102+ )
103+ }
99104 }
100105 . padding ( . leading, 2 )
101106
102- // TextField("", value: $daysBefore, format: .number)
103- // .textFieldStyle(RoundedBorderTextFieldStyle())
104- // .disableAutocorrection(true)
105- // .textContentType(.password)
106- // .frame(width: 40)
107- // .frame(alignment: .center)
108- // .multilineTextAlignment(.trailing)
109-
110107 Button ( action: {
111108 appDelegate. redrawBarItem ( )
112109 } ,
0 commit comments