From f5cb07184413675d7cfbd2fd08bf61a0f11767c2 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Mon, 1 Feb 2021 03:41:28 -0800 Subject: [PATCH] Fix worthwhile tests --- imgui/src/io.rs | 6 ++++-- imgui/src/style.rs | 11 +++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/imgui/src/io.rs b/imgui/src/io.rs index 18a9c69..6502bfb 100644 --- a/imgui/src/io.rs +++ b/imgui/src/io.rs @@ -188,6 +188,10 @@ pub struct Io { pub config_mac_os_behaviors: bool, /// Set to false to disable blinking cursor pub config_input_text_cursor_blink: bool, + /// Enable turning DragXXX widgets into text input with a simple mouse + /// click-release (without moving). Not desirable on devices without a + /// keyboard. + pub config_drag_click_to_input_text: bool, /// Enable resizing of windows from their edges and from the lower-left corner. /// /// Requires `HasMouserCursors` in `backend_flags`, because it needs mouse cursor feedback. @@ -213,7 +217,6 @@ pub struct Io { pub(crate) clipboard_user_data: *mut c_void, ime_set_input_screen_pos_fn: Option, ime_window_handle: *mut c_void, - // render_draw_lists_fn_unused: *mut c_void, /// Mouse position, in pixels. /// /// Set to [f32::MAX, f32::MAX] if mouse is unavailable (on another screen, etc.). @@ -437,7 +440,6 @@ fn test_io_memory_layout() { assert_field_offset!(clipboard_user_data, ClipboardUserData); assert_field_offset!(ime_set_input_screen_pos_fn, ImeSetInputScreenPosFn); assert_field_offset!(ime_window_handle, ImeWindowHandle); - // assert_field_offset!(render_draw_lists_fn_unused, RenderDrawListsFnUnused); assert_field_offset!(mouse_pos, MousePos); assert_field_offset!(mouse_down, MouseDown); assert_field_offset!(mouse_wheel, MouseWheel); diff --git a/imgui/src/style.rs b/imgui/src/style.rs index 79bcfbc..032cc10 100644 --- a/imgui/src/style.rs +++ b/imgui/src/style.rs @@ -62,6 +62,8 @@ pub struct Style { /// Horizontal and vertical spacing between elements of a composed widget (e.g. a slider and /// its label) pub item_inner_spacing: [f32; 2], + /// Padding within a table cell. + pub cell_padding: [f32; 2], /// Expand reactive bounding box for touch-based system where touch position is not accurate /// enough. /// @@ -144,7 +146,7 @@ pub struct Style { /// Decrease for higher quality but more geometry. pub circle_segment_max_error: f32, /// Style colors. - pub colors: [[f32; 4]; 48], + pub colors: [[f32; 4]; StyleColor::COUNT], } unsafe impl RawCast for Style {} @@ -199,13 +201,6 @@ impl IndexMut for Style { #[repr(u32)] #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] pub enum StyleColor { - // pub const ImGuiCol_TextSelectedBg: ImGuiCol_ = 47; - // pub const ImGuiCol_DragDropTarget: ImGuiCol_ = 48; - // pub const ImGuiCol_NavHighlight: ImGuiCol_ = 49; - // pub const ImGuiCol_NavWindowingHighlight: ImGuiCol_ = 50; - // pub const ImGuiCol_NavWindowingDimBg: ImGuiCol_ = 51; - // pub const ImGuiCol_ModalWindowDimBg: ImGuiCol_ = 52; - // pub const ImGuiCol_COUNT: ImGuiCol_ = 53; Text = sys::ImGuiCol_Text, TextDisabled = sys::ImGuiCol_TextDisabled, /// Background of normal windows