@@ -261,7 +261,7 @@ pub enum Overflow {
261
261
262
262
/// If specified, a checkmark 🗹 / ☐ to be prepended to the button text
263
263
#[ derive( Default , Clone , Copy , PartialEq , Eq ) ]
264
- pub enum Checkmark {
264
+ enum Checkmark {
265
265
/// No checkmark (or space for it)
266
266
#[ default]
267
267
Absent ,
@@ -295,14 +295,16 @@ impl ButtonStyle {
295
295
pub fn accelerator ( self , char : char ) -> Self {
296
296
Self { accelerator : Some ( char) , ..self }
297
297
}
298
- /// Draw a checkbox prefix: `[🗹 Example Button]`
299
- pub fn checkmark ( self , checkmark : Checkmark ) -> Self {
300
- Self { checkmark, ..self }
301
- }
302
298
/// Draw with or without brackets: `[Example Button]` or `Example Button`
303
299
pub fn bracketed ( self , bracketed : bool ) -> Self {
304
300
Self { bracketed, ..self }
305
301
}
302
+ /// Draw a checkbox prefix: `[🗹 Example Button]`
303
+ ///
304
+ /// Note: use `checkbox` or `menubar_menu_checkbox`
305
+ fn checkmark ( self , checkmark : Checkmark ) -> Self {
306
+ Self { checkmark, ..self }
307
+ }
306
308
}
307
309
308
310
impl Default for ButtonStyle {
@@ -3155,12 +3157,23 @@ impl<'a> Context<'a, '_> {
3155
3157
accelerator : char ,
3156
3158
shortcut : InputKey ,
3157
3159
) -> bool {
3158
- self . menubar_menu_checkbox ( text, accelerator, shortcut, Checkmark :: AlignOnly )
3160
+ self . menubar_menu_item ( text, accelerator, shortcut, Checkmark :: AlignOnly )
3159
3161
}
3160
3162
3161
3163
/// Appends a checkbox to the current menu.
3162
3164
/// Returns true if the checkbox was activated.
3163
3165
pub fn menubar_menu_checkbox (
3166
+ & mut self ,
3167
+ text : & str ,
3168
+ accelerator : char ,
3169
+ shortcut : InputKey ,
3170
+ checked : bool ,
3171
+ ) -> bool {
3172
+ self . menubar_menu_item ( text, accelerator, shortcut, checked. into ( ) )
3173
+ }
3174
+
3175
+ /// Appends a button or checkbox to the current menu,
3176
+ fn menubar_menu_item (
3164
3177
& mut self ,
3165
3178
text : & str ,
3166
3179
accelerator : char ,
0 commit comments