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