Fix worthwhile tests

This commit is contained in:
Thom Chiovoloni 2021-02-01 03:41:28 -08:00
parent a359c3940f
commit f5cb071844
2 changed files with 7 additions and 10 deletions

View File

@ -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<unsafe extern "C" fn(x: c_int, y: c_int)>,
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);

View File

@ -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<sys::ImGuiStyle> for Style {}
@ -199,13 +201,6 @@ impl IndexMut<StyleColor> 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