@@ -103,14 +103,16 @@ impl StyleSheet for Theme {
103
103
104
104
fn active ( & self , style : & Self :: Style , is_active : bool ) -> Appearance {
105
105
let mut appearance = Appearance :: default ( ) ;
106
+ let palette = self . extended_palette ( ) ;
106
107
107
108
match style {
108
109
TabBarStyles :: Default => {
109
110
appearance. tab_label_background = if is_active {
110
- Background :: Color ( [ 0.9 , 0.9 , 0.9 ] . into ( ) )
111
+ Background :: Color ( palette . primary . base . color )
111
112
} else {
112
- Background :: Color ( [ 0.87 , 0.87 , 0.87 ] . into ( ) )
113
+ Background :: Color ( palette . background . strong . color )
113
114
} ;
115
+ appearance. text_color = palette. background . base . text ;
114
116
}
115
117
TabBarStyles :: Dark => {
116
118
appearance. tab_label_background = if is_active {
@@ -186,9 +188,14 @@ impl StyleSheet for Theme {
186
188
}
187
189
188
190
fn hovered ( & self , style : & Self :: Style , is_active : bool ) -> Appearance {
191
+ let palette = self . extended_palette ( ) ;
189
192
match style {
190
193
TabBarStyles :: Default => Appearance {
191
- tab_label_background : Background :: Color ( [ 0.9 , 0.9 , 0.9 ] . into ( ) ) ,
194
+ tab_label_background : Background :: Color ( if is_active {
195
+ palette. background . strong . color
196
+ } else {
197
+ palette. primary . strong . color
198
+ } ) ,
192
199
..self . active ( style, is_active)
193
200
} ,
194
201
TabBarStyles :: Dark => Appearance {
0 commit comments