@@ -563,37 +563,48 @@ struct OpenClawStatusBadge: View {
563563}
564564
565565struct OpenClawPrimaryButtonStyle : ButtonStyle {
566+ @ Environment ( \. isEnabled ) private var isEnabled
567+
566568 func makeBody ( configuration : Configuration ) -> some View {
567569 configuration . label
568570 . font ( OpenClawType . headline )
569- . foregroundStyle ( . white )
571+ . foregroundStyle ( self . isEnabled ? Color . white : OpenClawBrand . textSecondary )
570572 . frame ( maxWidth : . infinity , minHeight : 48 )
571573 . background {
572574 RoundedRectangle ( cornerRadius : OpenClawRadius . sm , style : . continuous )
573575 . fill (
574- configuration . isPressed
576+ ! self . isEnabled
577+ ? Color ( uiColor : . tertiarySystemFill )
578+ : configuration . isPressed
575579 ? OpenClawBrand . accentPressed
576580 : OpenClawBrand . accent )
577581 }
578582 . animation ( . easeOut ( duration : 0.15 ) , value : configuration . isPressed )
583+ . animation ( . easeOut ( duration : 0.15 ) , value : self . isEnabled )
579584 }
580585}
581586
582587struct OpenClawSecondaryButtonStyle : ButtonStyle {
588+ @ Environment ( \. isEnabled ) private var isEnabled
589+
583590 func makeBody ( configuration : Configuration ) -> some View {
584591 configuration . label
585592 . font ( OpenClawType . headline )
586- . foregroundStyle ( OpenClawBrand . textPrimary )
593+ . foregroundStyle ( self . isEnabled ? OpenClawBrand . textPrimary : OpenClawBrand . textSecondary . opacity ( 0.68 ) )
587594 . frame ( maxWidth : . infinity , minHeight : 48 )
588595 . background {
589596 RoundedRectangle ( cornerRadius : OpenClawRadius . sm , style : . continuous )
590- . fill ( Color ( uiColor : . secondarySystemBackground ) )
597+ . fill ( Color ( uiColor : self . isEnabled ? . secondarySystemBackground : . tertiarySystemFill ) )
591598 . overlay {
592599 RoundedRectangle ( cornerRadius : OpenClawRadius . sm , style : . continuous )
593- . strokeBorder ( Color ( uiColor : . separator ) . opacity ( 0.35 ) , lineWidth : 1 )
600+ . strokeBorder (
601+ Color ( uiColor : . separator ) . opacity ( self . isEnabled ? 0.35 : 0.20 ) ,
602+ lineWidth : 1 )
594603 }
595604 }
596- . opacity ( configuration . isPressed ? 0.82 : 1 )
605+ . opacity ( ! self . isEnabled ? 0.74 : configuration . isPressed ? 0.82 : 1 )
606+ . animation ( . easeOut ( duration : 0.15 ) , value : configuration . isPressed )
607+ . animation ( . easeOut ( duration : 0.15 ) , value : self . isEnabled )
597608 }
598609}
599610
0 commit comments