@@ -8,7 +8,7 @@ use crate::row;
8
8
use crate :: text;
9
9
use crate :: touch;
10
10
use crate :: {
11
- Align , Clipboard , Element , Hasher , HorizontalAlignment , Layout , Length ,
11
+ Align , Clipboard , Color , Element , Hasher , HorizontalAlignment , Layout , Length ,
12
12
Point , Rectangle , Row , Text , VerticalAlignment , Widget ,
13
13
} ;
14
14
@@ -39,6 +39,7 @@ pub struct Checkbox<Message, Renderer: self::Renderer + text::Renderer> {
39
39
spacing : u16 ,
40
40
text_size : Option < u16 > ,
41
41
font : Renderer :: Font ,
42
+ text_color : Option < Color > ,
42
43
style : Renderer :: Style ,
43
44
}
44
45
@@ -66,6 +67,7 @@ impl<Message, Renderer: self::Renderer + text::Renderer>
66
67
spacing : Renderer :: DEFAULT_SPACING ,
67
68
text_size : None ,
68
69
font : Renderer :: Font :: default ( ) ,
70
+ text_color : None ,
69
71
style : Renderer :: Style :: default ( ) ,
70
72
}
71
73
}
@@ -102,6 +104,12 @@ impl<Message, Renderer: self::Renderer + text::Renderer>
102
104
self
103
105
}
104
106
107
+ /// Sets the text color of the [`Checkbox`] button.
108
+ pub fn text_color ( mut self , color : Color ) -> Self {
109
+ self . text_color = Some ( color) ;
110
+ self
111
+ }
112
+
105
113
/// Sets the style of the [`Checkbox`].
106
114
pub fn style ( mut self , style : impl Into < Renderer :: Style > ) -> Self {
107
115
self . style = style. into ( ) ;
@@ -193,7 +201,7 @@ where
193
201
& self . label ,
194
202
self . text_size . unwrap_or ( renderer. default_size ( ) ) ,
195
203
self . font ,
196
- None ,
204
+ self . text_color ,
197
205
HorizontalAlignment :: Left ,
198
206
VerticalAlignment :: Center ,
199
207
) ;
0 commit comments