mirror of
https://github.com/emilk/egui.git
synced 2026-06-28 07:23:13 -04:00
toggle_value
This commit is contained in:
@@ -2082,8 +2082,8 @@ impl Ui {
|
||||
/// Click to toggle to bool.
|
||||
///
|
||||
/// See also [`Self::checkbox`].
|
||||
pub fn toggle_value(&mut self, selected: &mut bool, text: impl Into<WidgetText>) -> Response {
|
||||
let mut response = self.selectable_label(*selected, text);
|
||||
pub fn toggle_value<'a>(&mut self, selected: &mut bool, atoms: impl IntoAtoms<'a>) -> Response {
|
||||
let mut response = self.selectable_label(*selected, atoms);
|
||||
if response.clicked() {
|
||||
*selected = !*selected;
|
||||
response.mark_changed();
|
||||
|
||||
Reference in New Issue
Block a user