Skip to content

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 09 May 07:57
· 305 commits to main since this release

This release removes the last invalid Condition value from the safe API and splits several overly broad flag sets into type-safe options so Dear ImGui's runtime assertions can no longer be triggered from normal Rust code. It also aligns the unified release train to 0.12.0 across the workspace.

Highlights

  • Remove Condition::Never and make APIs that previously accepted invalid or overloaded condition/flag values use explicit option types instead.
  • Split the combo, table, color, tab, popup, multi-select, shortcut routing, drag/drop, and drag/slider APIs so mutually exclusive Dear ImGui choices cannot be combined accidentally.
  • Update dear-imgui-reflect so numeric widget helpers route slider and drag flags through the correct safe wrapper types.

Breaking Changes

  • Core (dear-imgui-rs)
    • Remove Condition::Never.
    • Change Window::content_size(...) to accept only the size vector.
    • Replace several public flag arguments with explicit option types or narrower flag sets: DragDropPayloadCond, ShortcutFlags, ShortcutOptions, ShortcutRoute, NextItemShortcutFlags, NextItemShortcutOptions, ItemKeyOwnerFlags, DragFlags, ComboBoxOptions, TableOptions, TableColumnWidth, TableColumnIndent, TableColumnStateFlags, ColorEditOptions, ColorPickerOptions, ColorButtonOptions, TabBarOptions, TabItemOptions, PopupContextOptions, MultiSelectOptions, MultiSelectBoxSelect, MultiSelectScopeKind, DrawCornerFlags, and PolylineFlags.
    • Update builder/setup structs to store typed options directly, including ComboBox::options, TableColumnSetup::width, and TableColumnSetup::indent.
    • Remove the ambiguous TableColumnSetup::init_width_or_weight() helper in favor of fixed_width() and stretch_weight().
  • Extensions
    • dear-imgui-reflect: numeric wrap_around now applies to drag widgets only.

Migration Guide

  • Replace Condition::Never with the nearest valid intent, usually Condition::Always, Condition::Once, or Condition::FirstUseEver.
  • For one-choice flag domains, move the choice into the dedicated option type instead of OR-ing unrelated bits together.
  // before
  // ui.shortcut_with_flags(chord, ShortcutFlags::REPEAT | ShortcutFlags::ROUTE_GLOBAL);
  //
  // after
  ui.shortcut_with_flags(
      chord,
      ShortcutOptions::new()
          .flags(ShortcutFlags::REPEAT)
          .route(ShortcutRoute::Global(ShortcutGlobalRouteFlags::NONE)),
  );
  • Update code that passed mixed flag domains to the new typed options instead of OR-ing everything into one flag value. The main new types are ShortcutOptions, ShortcutRoute, TableColumnIndent, MultiSelectClickPolicy, MultiSelectBoxSelect, MultiSelectScopeKind, DrawCornerFlags, and PolylineFlags.
  • For rounded rectangles and image corners, use DrawCornerFlags. For closed paths, set PolylineBuilder::closed(true) or pass PolylineFlags only to polyline/path APIs.
  • For table columns, move width and indentation into the typed helpers instead of encoding them into TableColumnFlags.
// before
// ui.table_setup_column("Name", TableColumnFlags::INDENT_ENABLE, Some(140.0), 0);
//
// after
ui.table_setup_column_with_indent(
    "Name",
    TableColumnFlags::NONE,
    Some(TableColumnWidth::Fixed(140.0)),
    Some(TableColumnIndent::Enable),
    0,
);
  • Replace TableColumnSetup::init_width_or_weight() with fixed_width() or stretch_weight(), and move indentation to TableColumnSetup::indent(...) or indent_enabled(...).
  • When touching shortcut routing or multi-select, split the former combined flags into the dedicated option types before passing them into the API.

Changed

  • Backends
    • Update the default WGPU 29 dependency family to 29.0.3, SDL3 bindings to sdl3 0.18.3 / sdl3-sys 0.6.5+SDL-3.4.8, and the WASM binding stack to wasm-bindgen 0.2.121 / web-sys and js-sys 0.3.98.
    • Re-export the selected WGPU crate as dear_imgui_wgpu::wgpu so tests and downstream integrations can name the exact WGPU major chosen by dear-imgui-wgpu's feature flags.

Fixed

  • Core (dear-imgui-rs)
    • Fixes #27, thanks @belst. Remove the invalid Condition::Never value that could reach Dear ImGui's assertion paths, and tighten the APIs that previously exposed unsupported condition values in helper builders.
    • Split tab bar fitting policy, table column indent policy, context popup mouse button, and multi-select click/box/scope policies out of their corresponding public flag sets so normal Rust code cannot combine invalid single-choice flag values or request NavWrapX outside Dear ImGui's supported window scope.
    • Split shortcut routing policy out of ShortcutFlags and NextItemShortcutFlags, and type global-only routing modifiers separately, so normal Rust code cannot combine route modes that Dear ImGui rejects.
    • Split rectangle corner rounding and polyline/path-stroke flags into DrawCornerFlags and PolylineFlags, so ImDrawFlags_Closed can no longer be passed to rounded rectangle APIs that reject it.
  • Extensions
    • dear-imgui-reflect: route slider and drag numeric flags through distinct helper methods so the derived widgets no longer emit invalid flag combinations for Dear ImGui.