@@ -200,27 +200,51 @@ private struct TimeAdjustButton: View {
200200 }
201201}
202202
203- private struct ResetButton : View {
203+ private struct IconLabelButton : View {
204+ let systemImage : String
205+ let title : String
206+ let role : ButtonRole ?
207+ let help : String
204208 let action : ( ) -> Void
205209 @State private var isHovered = false
206210
207211 var body : some View {
208- Button ( role: . cancel, action: action) {
209- Image ( systemName: " xmark " )
210- . font ( . system( size: 14 , weight: . medium) )
211- . frame ( width: 32 , height: 32 )
212- . background (
213- Circle ( )
214- . fill ( Color . primary. opacity ( isHovered ? 0.06 : 0 ) )
215- )
212+ Button ( role: role, action: action) {
213+ HStack ( spacing: 4 ) {
214+ Image ( systemName: systemImage)
215+ . font ( . system( size: 14 , weight: . medium) )
216+
217+ Text ( title)
218+ . font ( . system( size: 13 , weight: . semibold, design: . rounded) )
219+ }
220+ . padding ( . horizontal, 8 )
221+ . padding ( . vertical, 4 )
222+ . background (
223+ RoundedRectangle ( cornerRadius: 6 , style: . continuous)
224+ . fill ( Color . primary. opacity ( isHovered ? 0.06 : 0 ) )
225+ )
216226 }
217227 . buttonStyle ( . plain)
218228 . onHover { hovering in
219229 withAnimation ( . easeInOut( duration: 0.15 ) ) {
220230 isHovered = hovering
221231 }
222232 }
223- . help ( " Cancel Timer (⌃C) " )
233+ . help ( help)
234+ }
235+ }
236+
237+ private struct ResetButton : View {
238+ let action : ( ) -> Void
239+
240+ var body : some View {
241+ IconLabelButton (
242+ systemImage: " xmark " ,
243+ title: " Cancel " ,
244+ role: . cancel,
245+ help: " Cancel Timer (⌃C) " ,
246+ action: action
247+ )
224248 . background (
225249 // Hidden button for cancel timer
226250 Button ( " " ) {
@@ -234,25 +258,15 @@ private struct ResetButton: View {
234258
235259private struct RestartButton : View {
236260 let action : ( ) -> Void
237- @State private var isHovered = false
238261
239262 var body : some View {
240- Button ( action: action) {
241- Image ( systemName: " arrow.clockwise " )
242- . font ( . system( size: 14 , weight: . medium) )
243- . frame ( width: 32 , height: 32 )
244- . background (
245- Circle ( )
246- . fill ( Color . primary. opacity ( isHovered ? 0.06 : 0 ) )
247- )
248- }
249- . buttonStyle ( . plain)
250- . onHover { hovering in
251- withAnimation ( . easeInOut( duration: 0.15 ) ) {
252- isHovered = hovering
253- }
254- }
255- . help ( " Restart Timer (⌘R) " )
263+ IconLabelButton (
264+ systemImage: " arrow.clockwise " ,
265+ title: " Restart " ,
266+ role: nil ,
267+ help: " Restart Timer (⌘R) " ,
268+ action: action
269+ )
256270 . background (
257271 Button ( " " ) {
258272 action ( )
@@ -291,3 +305,4 @@ private struct RestartButton: View {
291305
292306 return StatefulPreview ( )
293307}
308+
0 commit comments