File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -2025,17 +2025,9 @@ impl<'a> Context<'a, '_> {
20252025 /// Creates a checkbox with the given text.
20262026 /// Returns true if the checkbox was activated.
20272027 pub fn checkbox ( & mut self , classname : & ' static str , text : & str , checked : & mut bool ) -> bool {
2028- self . styled_label_begin ( classname) ;
2029- self . attr_focusable ( ) ;
2030- if self . is_focused ( ) {
2031- self . attr_reverse ( ) ;
2032- }
2033- self . styled_label_add_text ( if * checked { "[🗹 " } else { "[☐ " } ) ;
2034- self . styled_label_add_text ( text) ;
2035- self . styled_label_add_text ( "]" ) ;
2036- self . styled_label_end ( ) ;
2028+ let activated =
2029+ self . button ( classname, text, ButtonStyle :: default ( ) . checkmark ( ( * checked) . into ( ) ) ) ;
20372030
2038- let activated = self . button_activated ( ) ;
20392031 if activated {
20402032 * checked = !* checked;
20412033 }
You can’t perform that action at this time.
0 commit comments