Skip to content

Commit

Permalink
color edits
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbox-irl committed Feb 21, 2022
1 parent f334bfb commit 4bb300e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions imgui/src/popups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use crate::Ui;
/// # use imgui::*;
/// # let mut imgui = Context::create();
/// # let ui = imgui.frame();
/// if ui.button(im_str!("Show modal")) {
/// ui.open_popup(im_str!("modal"));
/// if ui.button("Show modal") {
/// ui.open_popup("modal");
/// }
/// if let Some(_token) = ui.popup_modal("modal").begin_popup() {
/// if let Some(_token) = ui.begin_modal_popup("modal") {
/// ui.text("Content of my modal");
/// if ui.button(im_str!("OK")) {
/// if ui.button("OK") {
/// ui.close_current_popup();
/// }
/// };
Expand Down
17 changes: 7 additions & 10 deletions imgui/src/widget/color_editors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ bitflags! {
/// # let mut imgui = Context::create();
/// # let ui = imgui.frame();
/// # let mut color = [0.0, 0.0, 0.0, 1.0];
/// let ce = ColorEdit4::new("color_edit", &mut color);
/// if ce.build(&ui) {
/// if ui.color_edit4("color_edit", &mut color) {
/// println!("The color was changed");
/// }
/// ```
Expand Down Expand Up @@ -400,8 +399,7 @@ impl Ui {
/// # let mut imgui = Context::create();
/// # let ui = imgui.frame();
/// # let mut color = [0.0, 0.0, 0.0, 1.0];
/// let ce = ColorEdit4::new("color_edit", &mut color);
/// if ce.build(&ui) {
/// if ui.color_edit4("color_edit", &mut color) {
/// println!("The color was changed");
/// }
/// ```
Expand Down Expand Up @@ -619,8 +617,7 @@ impl Ui {
/// # let mut imgui = Context::create();
/// # let ui = imgui.frame();
/// # let mut color = [0.0, 0.0, 0.0, 1.0];
/// let cp = ColorPicker4::new("color_picker", &mut color);
/// if cp.build(&ui) {
/// if ui.color_picker4("color_picker", &mut color) {
/// println!("A color was picked");
/// }
/// ```
Expand Down Expand Up @@ -843,8 +840,7 @@ impl Ui {
/// # let mut imgui = Context::create();
/// # let ui = imgui.frame();
/// # let mut color = [0.0, 0.0, 0.0, 1.0];
/// let cp = ColorPicker4::new("color_picker", &mut color);
/// if cp.build(&ui) {
/// if ui.color_picker4("color_picker", &mut color) {
/// println!("A color was picked");
/// }
/// ```
Expand Down Expand Up @@ -1078,8 +1074,9 @@ impl Ui {
/// # use imgui::*;
/// # let mut imgui = Context::create();
/// # let ui = imgui.frame();
/// ColorButton::new(im_str!("color_button"), [1.0, 0.0, 0.0, 1.0])
/// .build(&ui);
/// if ui.color_button("color_button", [1.0, 0.0, 0.0, 1.0]) {
/// println!("pressed!");
/// }
/// ```
#[derive(Copy, Clone, Debug)]
#[must_use]
Expand Down

0 comments on commit 4bb300e

Please sign in to comment.