diff --git a/imgui-examples/examples/support/mod.rs b/imgui-examples/examples/support/mod.rs index 57d25b4..2d06c51 100644 --- a/imgui-examples/examples/support/mod.rs +++ b/imgui-examples/examples/support/mod.rs @@ -21,6 +21,7 @@ pub fn run bool>(title: String, clear_color: [f32; 4], mut run_ let display = Display::new(window, context, &events_loop).unwrap(); let mut imgui = ImGui::init(); + imgui.set_ini_filename(None); let mut renderer = Renderer::init(&mut imgui, &display).expect("Failed to initialize renderer"); configure_keys(&mut imgui); diff --git a/imgui-examples/examples/test_window_impl.rs b/imgui-examples/examples/test_window_impl.rs index 01ae2f5..2612f92 100644 --- a/imgui-examples/examples/test_window_impl.rs +++ b/imgui-examples/examples/test_window_impl.rs @@ -470,7 +470,7 @@ fn show_test_window<'a>(ui: &Ui<'a>, state: &mut State, opened: &mut bool) { ui.text(im_str!("Color widget with Float Display:")); ui.color_edit(im_str!("MyColor##2f"), &mut s.color) .flags(misc_flags) - .format(EditableColorFormat::Float) + .format(ColorFormat::Float) .build(); ui.text(im_str!("Color button with Picker:")); diff --git a/src/color_editors.rs b/src/color_editors.rs index 0139a2b..d5e602b 100644 --- a/src/color_editors.rs +++ b/src/color_editors.rs @@ -54,7 +54,7 @@ pub enum ColorPickerMode { /// Color component formatting. #[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub enum EditableColorFormat { +pub enum ColorFormat { /// Display values formatted as 0..255. U8, /// Display values formatted as 0.0..1.0. @@ -63,7 +63,7 @@ pub enum EditableColorFormat { /// Color editor preview style. #[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub enum EditableColorPreview { +pub enum ColorPreview { /// Don't show the alpha component. Opaque, /// Half of the preview area shows the alpha component using a checkerboard pattern. @@ -149,20 +149,20 @@ impl<'ui, 'p> ColorEdit<'ui, 'p> { } /// Sets the preview style. #[inline] - pub fn preview(mut self, preview: EditableColorPreview) -> Self { + pub fn preview(mut self, preview: ColorPreview) -> Self { self.flags.set( ImGuiColorEditFlags::AlphaPreviewHalf, - preview == EditableColorPreview::HalfAlpha, + preview == ColorPreview::HalfAlpha, ); self.flags.set( ImGuiColorEditFlags::AlphaPreview, - preview == EditableColorPreview::Alpha, + preview == ColorPreview::Alpha, ); self } /// (WIP) Currently only disables 0.0..1.0 limits in RGBA edition. /// - /// Note: you probably want to use EditableColorFormat::Float as well. + /// Note: you probably want to use ColorFormat::Float as well. #[inline] pub fn hdr(mut self, value: bool) -> Self { self.flags.set(ImGuiColorEditFlags::HDR, value); @@ -187,14 +187,14 @@ impl<'ui, 'p> ColorEdit<'ui, 'p> { } /// Sets the formatting style of color components. #[inline] - pub fn format(mut self, format: EditableColorFormat) -> Self { + pub fn format(mut self, format: ColorFormat) -> Self { self.flags.set( ImGuiColorEditFlags::Uint8, - format == EditableColorFormat::U8, + format == ColorFormat::U8, ); self.flags.set( ImGuiColorEditFlags::Float, - format == EditableColorFormat::Float, + format == ColorFormat::Float, ); self } @@ -283,14 +283,14 @@ impl<'ui, 'p> ColorPicker<'ui, 'p> { } /// Sets the preview style. #[inline] - pub fn preview(mut self, preview: EditableColorPreview) -> Self { + pub fn preview(mut self, preview: ColorPreview) -> Self { self.flags.set( ImGuiColorEditFlags::AlphaPreviewHalf, - preview == EditableColorPreview::HalfAlpha, + preview == ColorPreview::HalfAlpha, ); self.flags.set( ImGuiColorEditFlags::AlphaPreview, - preview == EditableColorPreview::Alpha, + preview == ColorPreview::Alpha, ); self } @@ -327,14 +327,14 @@ impl<'ui, 'p> ColorPicker<'ui, 'p> { } /// Sets the formatting style of color components. #[inline] - pub fn format(mut self, format: EditableColorFormat) -> Self { + pub fn format(mut self, format: ColorFormat) -> Self { self.flags.set( ImGuiColorEditFlags::Uint8, - format == EditableColorFormat::U8, + format == ColorFormat::U8, ); self.flags.set( ImGuiColorEditFlags::Float, - format == EditableColorFormat::Float, + format == ColorFormat::Float, ); self } @@ -402,27 +402,27 @@ impl<'ui, 'p> ColorButton<'ui, 'p> { } /// Sets the preview style. #[inline] - pub fn preview(mut self, preview: EditableColorPreview) -> Self { + pub fn preview(mut self, preview: ColorPreview) -> Self { self.flags.set( ImGuiColorEditFlags::AlphaPreviewHalf, - preview == EditableColorPreview::HalfAlpha, + preview == ColorPreview::HalfAlpha, ); self.flags.set( ImGuiColorEditFlags::AlphaPreview, - preview == EditableColorPreview::Alpha, + preview == ColorPreview::Alpha, ); self } /// Sets the formatting style of color components. #[inline] - pub fn format(mut self, format: EditableColorFormat) -> Self { + pub fn format(mut self, format: ColorFormat) -> Self { self.flags.set( ImGuiColorEditFlags::Uint8, - format == EditableColorFormat::U8, + format == ColorFormat::U8, ); self.flags.set( ImGuiColorEditFlags::Float, - format == EditableColorFormat::Float, + format == ColorFormat::Float, ); self } diff --git a/src/lib.rs b/src/lib.rs index 5285082..71d2b64 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,8 +38,7 @@ pub use sys::{ImDrawIdx, ImDrawVert, ImGuiColorEditFlags, ImGuiInputTextFlags, I ImGuiSelectableFlags, ImGuiCond, ImGuiCol, ImGuiStyle, ImGuiTreeNodeFlags, ImGuiWindowFlags, ImVec2, ImVec4}; pub use child_frame::ChildFrame; -pub use color_editors::{ColorButton, ColorEdit, ColorEditMode, ColorPicker, ColorPickerMode, - EditableColor, EditableColorFormat, EditableColorPreview}; +pub use color_editors::{ColorButton, ColorEdit, ColorEditMode, ColorFormat, ColorPicker, ColorPickerMode, ColorPreview, EditableColor}; pub use input::{InputFloat, InputFloat2, InputFloat3, InputFloat4, InputInt, InputInt2, InputInt3, InputInt4, InputText}; pub use menus::{Menu, MenuItem};