/ CHANGELOG.md
CHANGELOG.md
1 # egui changelog 2 All notable changes to the `egui` crate will be documented in this file. 3 4 NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_web`](egui_web/CHANGELOG.md), [`egui-winit`](egui-winit/CHANGELOG.md), [`egui_glium`](egui_glium/CHANGELOG.md), and [`egui_glow`](egui_glow/CHANGELOG.md) have their own changelogs! 5 6 7 ## Unreleased 8 9 ### Added ⭐ 10 * Added `Shape::Callback` for backend-specific painting, [with an example](https://github.com/emilk/egui/blob/master/eframe/examples/custom_3d_three-d.rs) ([#1351](https://github.com/emilk/egui/pull/1351)). 11 * Added `Frame::canvas` ([#1362](https://github.com/emilk/egui/pull/1362)). 12 * `Context::request_repaint` will wake up UI thread, if integrations has called `Context::set_request_repaint_callback` ([#1366](https://github.com/emilk/egui/pull/1366)). 13 * Added `Plot::allow_scroll`, `Plot::allow_zoom` no longer affects scrolling ([#1382](https://github.com/emilk/egui/pull/1382)). 14 * Added `Ui::push_id` to resolve id clashes ([#1374](https://github.com/emilk/egui/pull/1374)). 15 * Added `Frame::outer_margin`. 16 17 ### Changed 🔧 18 * `ClippedMesh` has been replaced with `ClippedPrimitive` ([#1351](https://github.com/emilk/egui/pull/1351)). 19 * Renamed `Frame::margin` to `Frame::inner_margin`. 20 * Renamed `AlphaImage` to `FontImage` to discourage any other use for it ([#1412](https://github.com/emilk/egui/pull/1412)). 21 * Warnings will pe painted on screen when there is an `Id` clash for `Grid`, `Plot` or `ScrollArea` ([#1452](https://github.com/emilk/egui/pull/1452)). 22 * `Checkbox` and `RadioButton` with an empty label (`""`) will now take up much less space ([#1456](https://github.com/emilk/egui/pull/1456)). 23 24 ### Fixed 🐛 25 * Fixed ComboBoxes always being rendered left-aligned ([#1304](https://github.com/emilk/egui/pull/1304)). 26 * Fixed ui code that could lead to a deadlock ([#1380](https://github.com/emilk/egui/pull/1380)). 27 * Text is darker and more readable in bright mode ([#1412](https://github.com/emilk/egui/pull/1412)). 28 * Fixed `Ui::add_visible` sometimes leaving the `Ui` in a disabled state. ([#1436](https://github.com/emilk/egui/issues/1436)). 29 30 ### Removed 🔥 31 * Removed the `single_threaded/multi_threaded` flags - egui is now always thread-safe ([#1390](https://github.com/emilk/egui/pull/1390)). 32 33 34 ## 0.17.0 - 2022-02-22 - Improved font selection and image handling 35 36 ### Added ⭐ 37 * Much improved font selection ([#1154](https://github.com/emilk/egui/pull/1154)): 38 * You can now select any font size and family using `RichText::size` amd `RichText::family` and the new `FontId`. 39 * Easily change text styles with `Style::text_styles`. 40 * Added `Ui::text_style_height`. 41 * Added `TextStyle::resolve`. 42 * Made the v-align and scale of user fonts tweakable ([#1241](https://github.com/emilk/egui/pull/1027)). 43 * Plot: 44 * Added `Plot::x_axis_formatter` and `Plot::y_axis_formatter` for custom axis labels ([#1130](https://github.com/emilk/egui/pull/1130)). 45 * Added `Plot::allow_boxed_zoom()`, `Plot::boxed_zoom_pointer()` for boxed zooming on plots ([#1188](https://github.com/emilk/egui/pull/1188)). 46 * Added plot pointer coordinates with `Plot::coordinates_formatter`. ([#1235](https://github.com/emilk/egui/pull/1235)). 47 * Added linked axis support for plots via `plot::LinkedAxisGroup` ([#1184](https://github.com/emilk/egui/pull/1184)). 48 * `Context::load_texture` to convert an image into a texture which can be displayed using e.g. `ui.image(texture, size)` ([#1110](https://github.com/emilk/egui/pull/1110)). 49 * `Ui::input_mut` to modify how subsequent widgets see the `InputState` and a convenience method `InputState::consume_key` for shortcuts or hotkeys ([#1212](https://github.com/emilk/egui/pull/1212)). 50 * Added `Ui::add_visible` and `Ui::add_visible_ui`. 51 * Added `CollapsingHeader::icon` to override the default open/close icon using a custom function. ([1147](https://github.com/emilk/egui/pull/1147)). 52 * Added `ui.data()`, `ctx.data()`, `ctx.options()` and `ctx.tessellation_options()` ([#1175](https://github.com/emilk/egui/pull/1175)). 53 * Added `Response::on_hover_text_at_pointer` as a convenience akin to `Response::on_hover_text` ([1179](https://github.com/emilk/egui/pull/1179)). 54 * Opt-in dependency on `tracing` crate for logging warnings ([#1192](https://github.com/emilk/egui/pull/1192)). 55 * Added `ui.weak(text)`. 56 * Added `Slider::step_by` ([1225](https://github.com/emilk/egui/pull/1225)). 57 * Added `Context::move_to_top` and `Context::top_most_layer` for managing the layer on the top ([#1242](https://github.com/emilk/egui/pull/1242)). 58 * Support a subset of macOS' emacs input field keybindings in `TextEdit` ([#1243](https://github.com/emilk/egui/pull/1243)). 59 * Added ability to scroll an UI into view without specifying an alignment ([1247](https://github.com/emilk/egui/pull/1247)). 60 * Added `Ui::scroll_to_rect` ([1252](https://github.com/emilk/egui/pull/1252)). 61 62 ### Changed 🔧 63 * ⚠️ `Context::input` and `Ui::input` now locks a mutex. This can lead to a dead-lock is used in an `if let` binding! 64 * `if let Some(pos) = ui.input().pointer.latest_pos()` and similar must now be rewritten on two lines. 65 * Search for this problem in your code using the regex `if let .*input`. 66 * Better contrast in the default light mode style ([#1238](https://github.com/emilk/egui/pull/1238)). 67 * Renamed `CtxRef` to `Context` ([#1050](https://github.com/emilk/egui/pull/1050)). 68 * `Context` can now be cloned and stored between frames ([#1050](https://github.com/emilk/egui/pull/1050)). 69 * Renamed `Ui::visible` to `Ui::is_visible`. 70 * Split `Event::Text` into `Event::Text` and `Event::Paste` ([#1058](https://github.com/emilk/egui/pull/1058)). 71 * Replaced `Style::body_text_style` with more generic `Style::text_styles` ([#1154](https://github.com/emilk/egui/pull/1154)). 72 * `TextStyle` is no longer `Copy` ([#1154](https://github.com/emilk/egui/pull/1154)). 73 * Replaced `TextEdit::text_style` with `TextEdit::font` ([#1154](https://github.com/emilk/egui/pull/1154)). 74 * `Plot::highlight` now takes a `bool` argument ([#1159](https://github.com/emilk/egui/pull/1159)). 75 * `ScrollArea::show` now returns a `ScrollAreaOutput`, so you might need to add `.inner` after the call to it ([#1166](https://github.com/emilk/egui/pull/1166)). 76 * Replaced `corner_radius: f32` with `rounding: Rounding`, allowing per-corner rounding settings ([#1206](https://github.com/emilk/egui/pull/1206)). 77 * Replaced Frame's `margin: Vec2` with `margin: Margin`, allowing for different margins on opposing sides ([#1219](https://github.com/emilk/egui/pull/1219)). 78 * Renamed `Plot::custom_label_func` to `Plot::label_formatter` ([#1235](https://github.com/emilk/egui/pull/1235)). 79 * `Areas::layer_id_at` ignores non-interatable layers (i.e. Tooltips) ([#1240](https://github.com/emilk/egui/pull/1240)). 80 * `ScrollArea`:s will not shrink below a certain minimum size, set by `min_scrolled_width/min_scrolled_height` ([1255](https://github.com/emilk/egui/pull/1255)). 81 * For integrations: 82 * `Output` has now been renamed `PlatformOutput` and `Context::run` now returns the new `FullOutput` ([#1292](https://github.com/emilk/egui/pull/1292)). 83 * `FontImage` has been replaced by `TexturesDelta` (found in `FullOutput`), describing what textures were loaded and freed each frame ([#1110](https://github.com/emilk/egui/pull/1110)). 84 * The painter must support partial texture updates ([#1149](https://github.com/emilk/egui/pull/1149)). 85 * Added `RawInput::max_texture_side` which should be filled in with e.g. `GL_MAX_TEXTURE_SIZE` ([#1154](https://github.com/emilk/egui/pull/1154)). 86 87 ### Fixed 🐛 88 * Plot `Orientation` was not public, although fields using this type were ([#1130](https://github.com/emilk/egui/pull/1130)). 89 * Context menus now respects the theme ([#1043](https://github.com/emilk/egui/pull/1043)). 90 * Calling `Context::set_pixels_per_point` before the first frame will now work. 91 * Tooltips that don't fit the window don't flicker anymore ([#1240](https://github.com/emilk/egui/pull/1240)). 92 * Scroll areas now follow text cursor ([#1252](https://github.com/emilk/egui/pull/1252)). 93 * Slider: correctly respond with drag and focus events when interacting with the value directly ([1270](https://github.com/emilk/egui/pull/1270)). 94 95 ### Contributors 🙏 96 * [4JX](https://github.com/4JX) 97 * [55nknown](https://github.com/55nknown) 98 * [AlanRace](https://github.com/AlanRace) 99 * [AlexxxRu](https://github.com/AlexxxRu) 100 * [awaken1ng](https://github.com/awaken1ng) 101 * [BctfN0HUK7Yg](https://github.com/BctfN0HUK7Yg) 102 * [Bromeon](https://github.com/Bromeon) 103 * [cat-state](https://github.com/cat) 104 * [danielkeller](https://github.com/danielkeller) 105 * [dvec](https://github.com/dvec) 106 * [Friz64](https://github.com/Friz64) 107 * [Gordon01](https://github.com/Gordon01) 108 * [HackerFoo](https://github.com/HackerFoo) 109 * [juancampa](https://github.com/juancampa) 110 * [justinj](https://github.com/justinj) 111 * [lampsitter](https://github.com/lampsitter) 112 * [LordMZTE](https://github.com/LordMZTE) 113 * [manuel-i](https://github.com/manuel) 114 * [Mingun](https://github.com/Mingun) 115 * [niklaskorz](https://github.com/niklaskorz) 116 * [nongiach](https://github.com/nongiach) 117 * [parasyte](https://github.com/parasyte) 118 * [psiphi75](https://github.com/psiphi75) 119 * [s-nie](https://github.com/s) 120 * [t18b219k](https://github.com/t18b219k) 121 * [terhechte](https://github.com/terhechte) 122 * [xudesheng](https://github.com/xudesheng) 123 * [yusdacra](https://github.com/yusdacra) 124 125 126 ## 0.16.1 - 2021-12-31 - Add back `CtxRef::begin_frame,end_frame` 127 128 ### Added ⭐ 129 * Add back `CtxRef::begin_frame,end_frame` as an alternative to `CtxRef::run`. 130 131 132 ## 0.16.0 - 2021-12-29 - Context menus and rich text 133 134 ### Added ⭐ 135 * Added context menus: See `Ui::menu_button` and `Response::context_menu` ([#543](https://github.com/emilk/egui/pull/543)). 136 * Most widgets containing text (`Label`, `Button` etc) now supports rich text ([#855](https://github.com/emilk/egui/pull/855)). 137 * Plots: 138 * Added bar charts and box plots ([#863](https://github.com/emilk/egui/pull/863)). 139 * You can now query information about the plot (e.g. get the mouse position in plot coordinates, or the plot 140 bounds) while adding items. `Plot` ([#766](https://github.com/emilk/egui/pull/766) and 141 [#892](https://github.com/emilk/egui/pull/892)). 142 * You can now read and write the cursor of a `TextEdit` ([#848](https://github.com/emilk/egui/pull/848)). 143 * When using a custom font you can now specify a font index ([#873](https://github.com/emilk/egui/pull/873)). 144 * Added vertical sliders with `Slider::new(…).vertical()` ([#875](https://github.com/emilk/egui/pull/875)). 145 * Added `Button::image_and_text` ([#832](https://github.com/emilk/egui/pull/832)). 146 * Added `CollapsingHeader::open` to control if it is open or collapsed ([#1006](https://github.com/emilk/egui/pull/1006)). 147 * Added `egui::widgets::color_picker::color_picker_color32` to show the color picker. 148 149 ### Changed 🔧 150 * MSRV (Minimum Supported Rust Version) is now `1.56.0`. 151 * `ui.add(Button::new("…").text_color(…))` is now `ui.button(RichText::new("…").color(…))` (same for `Label` )([#855](https://github.com/emilk/egui/pull/855)). 152 * Plots now provide a `show` method that has to be used to add items to and show the plot ([#766](https://github.com/emilk/egui/pull/766)). 153 * `menu::menu(ui, ...)` is now `ui.menu_button(...)` ([#543](https://github.com/emilk/egui/pull/543)) 154 * Replaced `CtxRef::begin_frame` and `end_frame` with `CtxRef::run` ([#872](https://github.com/emilk/egui/pull/872)). 155 * Replaced `scroll_delta` and `zoom_delta` in `RawInput` with `Event::Scroll` and `Event::Zoom`. 156 * Unified the four `Memory` data buckets (`data`, `data_temp`, `id_data` and `id_data_temp`) into a single `Memory::data`, with a new interface ([#836](https://github.com/emilk/egui/pull/836)). 157 * Replaced `Ui::__test` with `egui::__run_test_ui` ([#872](https://github.com/emilk/egui/pull/872)). 158 159 ### Fixed 🐛 160 * Fixed `ComboBox` and other popups getting clipped to parent window ([#885](https://github.com/emilk/egui/pull/885)). 161 * The color picker is now better at keeping the same hue even when saturation goes to zero ([#886](https://github.com/emilk/egui/pull/886)). 162 163 ### Removed 🔥 164 * Removed `egui::math` (use `egui::emath` instead). 165 * Removed `egui::paint` (use `egui::epaint` instead). 166 167 ### Contributors 🙏 168 * [5225225](https://github.com/5225225): [#849](https://github.com/emilk/egui/pull/849). 169 * [aevyrie](https://github.com/aevyrie): [#966](https://github.com/emilk/egui/pull/966). 170 * [B-Reif](https://github.com/B-Reif): [#875](https://github.com/emilk/egui/pull/875). 171 * [Bromeon](https://github.com/Bromeon): [#863](https://github.com/emilk/egui/pull/863), [#918](https://github.com/emilk/egui/pull/918). 172 * [d10sfan](https://github.com/d10sfan): [#832](https://github.com/emilk/egui/pull/832). 173 * [EmbersArc](https://github.com/EmbersArc): [#766](https://github.com/emilk/egui/pull/766), [#892](https://github.com/emilk/egui/pull/892). 174 * [Hperigo](https://github.com/Hperigo): [#905](https://github.com/emilk/egui/pull/905). 175 * [isegal](https://github.com/isegal): [#934](https://github.com/emilk/egui/pull/934). 176 * [mankinskin](https://github.com/mankinskin): [#543](https://github.com/emilk/egui/pull/543). 177 * [niladic](https://github.com/niladic): [#499](https://github.com/emilk/egui/pull/499), [#863](https://github.com/emilk/egui/pull/863). 178 * [singalen](https://github.com/singalen): [#973](https://github.com/emilk/egui/pull/973). 179 * [sumibi-yakitori](https://github.com/sumibi-yakitori): [#830](https://github.com/emilk/egui/pull/830), [#870](https://github.com/emilk/egui/pull/870). 180 * [t18b219k](https://github.com/t18b219k): [#868](https://github.com/emilk/egui/pull/868), [#888](https://github.com/emilk/egui/pull/888). 181 182 183 ## 0.15.0 - 2021-10-24 - Syntax highlighting and hscroll 184 185 <img src="media/egui-0.15-code-editor.gif"> 186 187 ### Added ⭐ 188 * Add horizontal scrolling support to `ScrollArea` and `Window` (opt-in). 189 * `TextEdit::layouter`: Add custom text layout for e.g. syntax highlighting or WYSIWYG. 190 * `Fonts::layout_job`: New text layout engine allowing mixing fonts, colors and styles, with underlining and strikethrough. 191 * Add `ui.add_enabled(bool, widget)` to easily add a possibly disabled widget. 192 * Add `ui.add_enabled_ui(bool, |ui| …)` to create a possibly disabled UI section. 193 * Add feature `"serialize"` separatedly from `"persistence"`. 194 * Add `egui::widgets::global_dark_light_mode_buttons` to easily add buttons for switching the egui theme. 195 * `TextEdit` can now be used to show text which can be selected and copied, but not edited. 196 * Add `Memory::caches` for caching things from one frame to the next. 197 198 ### Changed 🔧 199 * Change the default monospace font to [Hack](https://github.com/source-foundry/Hack). 200 * Label text will now be centered, right-aligned and/or justified based on the layout of the `Ui` it is in. 201 * `Hyperlink` will now word-wrap just like a `Label`. 202 * All `Ui`:s must now have a finite `max_rect`. 203 * Deprecated: `max_rect_finite`, `available_size_before_wrap_finite` and `available_rect_before_wrap_finite`. 204 * `Painter`/`Fonts`: text layout now expect a color when creating a `Galley`. You may override that color with `Painter::galley_with_color`. 205 * MSRV (Minimum Supported Rust Version) is now `1.54.0`. 206 * By default, `DragValue`:s no longer show a tooltip when hovered. Change with `Style::explanation_tooltips`. 207 * Smaller and nicer color picker. 208 * `ScrollArea` will auto-shrink to content size unless told otherwise using `ScollArea::auto_shrink`. 209 * By default, `Slider`'s `clamp_to_range` is set to true. 210 * Rename `TextEdit::enabled` to `TextEdit::interactive`. 211 * `ui.label` (and friends) now take `impl ToString` as argument instead of `impl Into<Label>`. 212 213 ### Fixed 🐛 214 * Fix wrongly sized multiline `TextEdit` in justified layouts. 215 * Fix clip rectangle of windows that don't fit the central area. 216 * Show tooltips above widgets on touch screens. 217 * Fix popups sometimes getting clipped by panels. 218 219 ### Removed 🔥 220 * Replace `Button::enabled` with `ui.add_enabled`. 221 222 ### Contributors 🙏 223 * [AlexApps99](https://github.com/AlexApps99) 224 * [baysmith](https://github.com/baysmith) 225 * [bpostlethwaite](https://github.com/bpostlethwaite) 226 * [cwfitzgerald](https://github.com/cwfitzgerald) 227 * [DrOptix](https://github.com/DrOptix) 228 * [JerzySpendel](https://github.com/JerzySpendel) 229 * [NiceneNerd](https://github.com/NiceneNerd) 230 * [parasyte](https://github.com/parasyte) 231 * [spersson](https://github.com/spersson) 232 * [Stock84-dev](https://github.com/Stock84-dev) 233 * [sumibi-yakitori](https://github.com/sumibi-yakitori) 234 * [t18b219k](https://github.com/t18b219k) 235 * [TobTobXX](https://github.com/TobTobXX) 236 * [zu1k](https://github.com/zu1k) 237 238 239 ## 0.14.2 - 2021-08-28 - Window resize fix 240 241 ### Fixed 🐛 242 * Fix window resize bug introduced in `0.14.1`. 243 244 245 ## 0.14.1 - 2021-08-28 - Layout bug fixes 246 247 ### Added ⭐ 248 * Add `Ui::horizontal_top`. 249 250 ### Fixed 🐛 251 * Fix `set_width/set_min_width/set_height/set_min_height/expand_to_include_x/expand_to_include_y`. 252 * Make minimum grid column width propagate properly. 253 * Make sure `TextEdit` contents expand to fill width if applicable. 254 * `ProgressBar`: add a minimum width and fix for having it in an infinite layout. 255 * Fix sometimes not being able to click inside a combo box or popup menu. 256 257 258 ## 0.14.0 - 2021-08-24 - Ui panels and bug fixes 259 260 ### Added ⭐ 261 * Panels can now be added to any `Ui`. 262 * Plot: 263 * [Line styles](https://github.com/emilk/egui/pull/482). 264 * Add `show_background` and `show_axes` methods to `Plot`. 265 * [Progress bar](https://github.com/emilk/egui/pull/519). 266 * `Grid::num_columns`: allow the last column to take up the rest of the space of the parent `Ui`. 267 * Add an API for dropping files into egui (see `RawInput`). 268 * `CollapsingHeader` can now optionally be selectable. 269 270 ### Changed 🔧 271 * A single-line `TextEdit` will now clip text that doesn't fit in it, and scroll. 272 * Return closure return value from `Area::show`, `ComboBox::show_ui`, `ComboBox::combo_box_with_label`, `Window::show`, `popup::*`, `menu::menu`. 273 * Only move/resize windows with primary mouse button. 274 * Tooltips are now moved to not cover the widget they are attached to. 275 276 ### Fixed 🐛 277 * Fix custom font definitions getting replaced when `pixels_per_point` is changed. 278 * Fix `lost_focus` for `TextEdit`. 279 * Clicking the edge of a menu button will now properly open the menu. 280 * Fix hover detection close to an `Area`. 281 * Fix case where `Plot`'s `min_auto_bounds` could be ignored after the first call to `Plot::ui`. 282 * Fix slow startup when using large font files. 283 284 ### Contributors 🙏 285 * [barrowsys](https://github.com/barrowsys) 286 * [EmbersArc](https://github.com/EmbersArc) 287 * [gents83](https://github.com/gents83 ) 288 * [lucaspoffo](https://github.com/lucaspoffo) 289 * [mankinskin](https://github.com/mankinskin) 290 * [mental32](https://github.com/mental32) 291 * [mitchmindtree](https://github.com/mitchmindtree) 292 * [parasyte](https://github.com/parasyte) 293 * [rekka](https://github.com/rekka) 294 * [zu1k](https://github.com/zu1k) 295 296 297 ## 0.13.1 - 2021-06-28 - Plot fixes 298 299 ### Added ⭐ 300 * Plot: you can now set the stroke of a `HLine/VLine`. 301 302 ### Changed 🔧 303 * `Plot::new` now takes an `id_source: impl Hash` instead of a `name: impl ToString`. Functionally it is the same. 304 305 306 ## 0.13.0 - 2021-06-24 - Better panels, plots and new visual style 307 308 ### Added ⭐ 309 * Plot: 310 * [More plot items: Arrows, Polygons, Text, Images](https://github.com/emilk/egui/pull/471). 311 * [Plot legend improvements](https://github.com/emilk/egui/pull/410). 312 * [Line markers for plots](https://github.com/emilk/egui/pull/363). 313 * Panels: 314 * Add right and bottom panels (`SidePanel::right` and `Panel::bottom`). 315 * Panels can now be resized. 316 * Add an option to overwrite frame of a `Panel`. 317 * [Improve accessibility / screen reader](https://github.com/emilk/egui/pull/412). 318 * Add `ScrollArea::show_rows` for efficient scrolling of huge UI:s. 319 * Add `ScrollArea::enable_scrolling` to allow freezing scrolling when editing TextEdit widgets within it 320 * Add `Ui::set_visible` as a way to hide widgets. 321 * Add `Style::override_text_style` to easily change the text style of everything in a `Ui` (or globally). 322 * You can now change `TextStyle` on checkboxes, radio buttons and `SelectableLabel`. 323 * Add support for [cint](https://crates.io/crates/cint) under `cint` feature. 324 * Add features `extra_asserts` and `extra_debug_asserts` to enable additional checks. 325 * `TextEdit` now supports edits on a generic buffer using `TextBuffer`. 326 * Add `Context::set_debug_on_hover` and `egui::trace!(ui)` 327 328 ### Changed 🔧 329 * Minimum Rust version is now 1.51 (used to be 1.52) 330 * [Tweaked the default visuals style](https://github.com/emilk/egui/pull/450). 331 * Plot: Renamed `Curve` to `Line`. 332 * `TopPanel::top` is now `TopBottomPanel::top`. 333 * `SidePanel::left` no longet takes the default width by argument, but by a builder call. 334 * `SidePanel::left` is resizable by default. 335 336 ### Fixed 🐛 337 * Fix uneven lettering on non-integral device scales ("extortion lettering"). 338 * Fix invisible scroll bar when native window is too narrow for egui. 339 340 341 ## 0.12.0 - 2021-05-10 - Multitouch, user memory, window pivots, and improved plots 342 343 ### Added ⭐ 344 * Add anchors to windows and areas so you can put a window in e.g. the top right corner. 345 * Make labels interactive with `Label::sense(Sense::click())`. 346 * Add `Response::request_focus` and `Response::surrender_focus`. 347 * Add `TextEdit::code_editor` (VERY basic). 348 * [Pan and zoom plots](https://github.com/emilk/egui/pull/317). 349 * [Add plot legends](https://github.com/emilk/egui/pull/349). 350 * [Users can now store custom state in `egui::Memory`](https://github.com/emilk/egui/pull/257). 351 * Add `Response::on_disabled_hover_text` to show tooltip for disabled widgets. 352 * Zoom input: ctrl-scroll and (on `egui_web`) trackpad-pinch gesture. 353 * Support for raw [multi touch](https://github.com/emilk/egui/pull/306) events, 354 enabling zoom, rotate, and more. Works with `egui_web` on mobile devices, 355 and should work with `egui_glium` for certain touch devices/screens. 356 * Add (optional) compatibility with [mint](https://docs.rs/mint). 357 358 ### Changed 🔧 359 * Make `Memory::has_focus` public (again). 360 * `Plot` must now be given a name that is unique within its scope. 361 * Tab only selects labels if the `screen_reader` option is turned on. 362 * Rename `ui.wrap` to `ui.scope`. 363 364 ### Fixed 🐛 365 * Fix [defocus-bug on touch screens](https://github.com/emilk/egui/issues/288). 366 * Fix bug with the layout of wide `DragValue`:s. 367 368 ### Removed 🔥 369 * Moved experimental markup language to `egui_demo_lib` 370 371 372 ## 0.11.0 - 2021-04-05 - Optimization, screen reader & new layout logic 373 374 ### Added ⭐ 375 * You can now give focus to any clickable widget with tab/shift-tab. 376 * Use space or enter to click the selected widget. 377 * Use arrow keys to adjust sliders and `DragValue`s. 378 * egui will now output events when widgets gain keyboard focus. 379 * This can be hooked up to a screen reader to aid the visually impaired 380 * Add the option to restrict the dragging bounds of `Window` and `Area` to a specified area using `drag_bounds(rect)`. 381 * Add support for small and raised text. 382 * Add `ui.set_row_height`. 383 * Add `DebugOptions::show_widgets` to debug layouting by hovering widgets. 384 * Add `ComboBox` to more easily customize combo boxes. 385 * Add `Slider::new` and `DragValue::new` to replace old type-specific constructors. 386 * Add `TextEdit::password` to hide input characters. 387 388 ### Changed 🔧 389 * `ui.advance_cursor` is now called `ui.add_space`. 390 * `kb_focus` is now just called `focus`. 391 392 ### Fixed 🐛 393 * Fix some bugs related to centered layouts. 394 * Fixed secondary-click to open a menu. 395 * [Fix panic for zero-range sliders and zero-speed drag values](https://github.com/emilk/egui/pull/216). 396 * Fix false id clash error for wrapping text. 397 * Fix bug that would close a popup (e.g. the color picker) when clicking inside of it. 398 399 ### Deprecated ☢️ 400 * Deprectated `combo_box_with_label` in favor of new `ComboBox`. 401 * Deprectated type-specific constructors for `Slider` and `DragValue` (`Slider::f32`, `DragValue::usize` etc). 402 403 404 ## 0.10.0 - 2021-02-28 - Plot and polish 405 406 <img src="media/egui-0.10-plot.gif" width="50%"> 407 408 ### Added ⭐ 409 * Add `egui::plot::Plot` to plot some 2D data. 410 * Add `Ui::hyperlink_to(label, url)`. 411 * Sliders can now have a value prefix and suffix (e.g. the suffix `"°"` works like a unit). 412 * `Context::set_pixels_per_point` to control the scale of the UI. 413 * Add `Response::changed()` to query if e.g. a slider was dragged, text was entered or a checkbox was clicked. 414 * Add support for all integers in `DragValue` and `Slider` (except 128-bit). 415 416 ### Changed 🔧 417 * Improve the positioning of tooltips. 418 * Only show tooltips if mouse is still. 419 * `Slider` will now show the value display by default, unless turned off with `.show_value(false)`. 420 * The `Slider` value is now a `DragValue` which when dragged can pick values outside of the slider range (unless `clamp_to_range` is set). 421 422 423 ## 0.9.0 - 2021-02-07 - Light Mode and much more 424 425 <img src="media/0.9.0-disabled.gif" width="50%"> 426 427 ### Added ⭐ 428 * Add support for secondary and middle mouse buttons. 429 * Add `Label` methods for code, strong, strikethrough, underline and italics. 430 * Add `ui.group(|ui| { … })` to visually group some widgets within a frame. 431 * Add `Ui` helpers for doing manual layout (`ui.put`, `ui.allocate_ui_at_rect` and more). 432 * Add `ui.set_enabled(false)` to disable all widgets in a `Ui` (grayed out and non-interactive). 433 * Add `TextEdit::hint_text` for showing a weak hint text when empty. 434 * `egui::popup::popup_below_widget`: show a popup area below another widget. 435 * Add `Slider::clamp_to_range(bool)`: if set, clamp the incoming and outgoing values to the slider range. 436 * Add: `ui.spacing()`, `ui.spacing_mut()`, `ui.visuals()`, `ui.visuals_mut()`. 437 * Add: `ctx.set_visuals()`. 438 * You can now control text wrapping with `Style::wrap`. 439 * Add `Grid::max_col_width`. 440 441 ### Changed 🔧 442 * Text will now wrap at newlines, spaces, dashes, punctuation or in the middle of a words if necessary, in that order of priority. 443 * Widgets will now always line break at `\n` characters. 444 * Widgets will now more intelligently choose whether or not to wrap text. 445 * `mouse` has been renamed `pointer` everywhere (to make it clear it includes touches too). 446 * Most parts of `Response` are now methods, so `if ui.button("…").clicked {` is now `if ui.button("…").clicked() {`. 447 * `Response::active` is now gone. You can use `response.dragged()` or `response.clicked()` instead. 448 * Backend: pointer (mouse/touch) position and buttons are now passed to egui in the event stream. 449 * `DragValue::range` is now called `clamp_range` and also clamps incoming values. 450 * Renamed `Triangles` to `Mesh`. 451 * The tessellator now wraps the clip rectangle and mesh in `struct ClippedMesh(Rect, Mesh)`. 452 * `Mesh::split_to_u16` now returns a 16-bit indexed `Mesh16`. 453 454 ### Fixed 🐛 455 * It is now possible to click widgets even when FPS is very low. 456 * Tessellator: handle sharp path corners better (switch to bevel instead of miter joints for > 90°). 457 458 459 ## 0.8.0 - 2021-01-17 - Grid layout & new visual style 460 461 <img src="media/widget_gallery_0.8.0.gif" width="50%"> 462 463 ### Added ⭐ 464 * Added a simple grid layout (`Grid`). 465 * Added `ui.allocate_at_least` and `ui.allocate_exact_size`. 466 * Added function `InputState::key_down`. 467 * Added `Window::current_pos` to position a window. 468 469 ### Changed 🔧 470 * New simpler and sleeker look! 471 * Rename `PaintCmd` to `Shape`. 472 * Replace tuple `(Rect, Shape)` with tuple-struct `ClippedShape`. 473 * Rename feature `"serde"` to `"persistence"`. 474 * Break out the modules `math` and `paint` into separate crates `emath` and `epaint`. 475 476 ### Fixed 🐛 477 * Fixed a bug that would sometimes trigger a "Mismatching panels" panic in debug builds. 478 * `Image` and `ImageButton` will no longer stretch to fill a justified layout. 479 480 481 ## 0.7.0 - 2021-01-04 482 483 ### Added ⭐ 484 * Add `ui.scroll_to_cursor` and `response.scroll_to_me` ([#81](https://github.com/emilk/egui/pull/81) by [lucaspoffo](https://github.com/lucaspoffo)). 485 * Add `window.id(…)` and `area.id(…)` for overriding the default `Id`. 486 487 ### Changed 🔧 488 * Renamed `Srgba` to `Color32`. 489 * All color contructions now starts with `from_`, e.g. `Color32::from_rgb`. 490 * Renamed `FontFamily::VariableWidth` to `FontFamily::Proportional`. 491 * Removed `pixels_per_point` from `FontDefinitions`. 492 493 ### Fixed 🐛 494 * `RepaintSignal` now implements `Sync` so it can be sent to a background thread. 495 * `TextEdit` widgets are now slightly larger to accommodate their frames. 496 497 ### Deprecated ☢️ 498 * Deprecated `color::srgba`. 499 500 501 ## 0.6.0 - 2020-12-26 502 503 ### Added ⭐ 504 * Turn off `Window` title bars with `window.title_bar(false)`. 505 * `ImageButton` - `ui.add(ImageButton::new(…))`. 506 * `ui.vertical_centered` and `ui.vertical_centered_justified`. 507 * `ui.allocate_painter` helper. 508 * Mouse-over explanation to duplicate ID warning. 509 * You can now easily constrain egui to a portion of the screen using `RawInput::screen_rect`. 510 * You can now control the minimum and maixumum number of decimals to show in a `Slider` or `DragValue`. 511 * Add `egui::math::Rot2`: rotation helper. 512 * `Response` now contains the `Id` of the widget it pertains to. 513 * `ui.allocate_response` that allocates space and checks for interactions. 514 * Add `response.interact(sense)`, e.g. to check for clicks on labels. 515 516 ### Changed 🔧 517 * `ui.allocate_space` now returns an `(Id, Rect)` tuple. 518 * `Arc<Context>` has been replaced with `CtxRef` everywhere. 519 * Slight tweak of the default `Style` and font sizes. 520 * `SidePanel::left` and `TopPanel::top` now takes `impl Hash` as first argument. 521 * A `Window` may now cover an existing `CentralPanel`. 522 * `ui.image` now takes `impl Into<Vec2>` as a `size` argument. 523 * Made some more fields of `RawInput` optional. 524 * `Slider` and `DragValue` uses fewer decimals by default. See the full precision by hovering over the value. 525 * `egui::App`: added `fn name(&self)` and `fn clear_color(&self)`. 526 * Combo boxes has scroll bars when needed. 527 * Expand `Window` + `Resize` containers to be large enough for last frames content 528 * `ui.columns`: Columns now defaults to justified top-to-down layouts. 529 * Rename `Sense::nothing()` to `Sense::hover()`. 530 * Replaced `parking_lot` dependency with `atomic_refcell` by default. 531 532 ### Fixed 🐛 533 * The background for `CentralPanel` will now cover unused space too. 534 * `ui.columns`: Improve allocated size estimation. 535 536 ### Deprecated ☢️ 537 * `RawInput::screen_size` - use `RawInput::screen_rect` instead. 538 * left/centered/right column functions on `Ui`. 539 * `ui.interact_hover` and `ui.hovered`. 540 541 542 ## 0.5.0 - 2020-12-13 543 544 ### Added ⭐ 545 * Emoji support: 1216 different emojis that work in any text. 546 * The Demo app comes with a Font Book to explore the available glyphs. 547 * `ui.horizontal_wrapped(|ui| …)`: Add widgets on a row but wrap at `max_size`. 548 * `ui.horizontal_wrapped_for_text`: Like `ui.horizontal_wrapped`, but with spacing made for embedding text. 549 * `ui.horizontal_for_text`: Like `ui.horizontal`, but with spacing made for embedding text. 550 * `egui::Layout` now supports justified layouts where contents is _also_ centered, right-aligned, etc. 551 * `ui.allocate_ui(size, |ui| …)`: Easily create a child-`Ui` of a given size. 552 * `SelectableLabel` (`ui.selectable_label` and `ui.selectable_value`): A text-button that can be selected. 553 * `ui.small_button`: A smaller button that looks good embedded in text. 554 * `ui.drag_angle_tau`: For those who want to specify angles as fractions of τ (a full turn). 555 * Add `Resize::id_source` and `ScrollArea::id_source` to let the user avoid Id clashes. 556 557 ### Changed 🔧 558 * New default font: [Ubuntu-Light](https://fonts.google.com/specimen/Ubuntu). 559 * Make it simpler to override fonts in `FontDefinitions`. 560 * Remove minimum button width. 561 * Refactor `egui::Layout` substantially, changing its interface. 562 * Calling `on_hover_text`/`on_hover_ui` multiple times will stack tooltips underneath the previous ones. 563 * Text wrapping on labels, buttons, checkboxes and radio buttons is now based on the layout. 564 565 ### Removed 🔥 566 567 * Removed the `label!` macro. 568 569 570 ## 0.4.0 - 2020-11-28 571 572 ### Added ⭐ 573 * `TextEdit` improvements: 574 * Much improved text editing, with better navigation and selection. 575 * Move focus between `TextEdit` widgets with tab and shift-tab. 576 * Undo edtis in a `TextEdit`. 577 * You can now check if a `TextEdit` lost keyboard focus with `response.lost_focus`. 578 * Added `ui.text_edit_singleline` and `ui.text_edit_multiline`. 579 * You can now debug why your `Ui` is unexpectedly wide with `ui.style_mut().debug.show_expand_width = true;` 580 581 ### Changed 🔧 582 * Pressing enter in a single-line `TextEdit` will now surrender keyboard focus for it. 583 * You must now be explicit when creating a `TextEdit` if you want it to be singeline or multiline. 584 * Improved automatic `Id` generation, making `Id` clashes less likely. 585 * egui now requires modifier key state from the integration 586 * Added, renamed and removed some keys in the `Key` enum. 587 * Fixed incorrect text wrapping width on radio buttons 588 589 ### Fixed 🐛 590 * Fixed bug where a lost widget could still retain keyboard focus. 591 592 593 ## 0.3.0 - 2020-11-07 594 595 ### Added ⭐ 596 * Panels: you can now create panels using `SidePanel`, `TopPanel` and `CentralPanel`. 597 * You can now override the default egui fonts. 598 * Add ability to override text color with `visuals.override_text_color`. 599 * The demo now includes a simple drag-and-drop example. 600 * The demo app now has a slider to scale all of egui. 601 602 ### Changed 🔧 603 * `ui.horizontal(…)` etc returns `Response`. 604 * Refactored the interface for `egui::app::App`. 605 * Windows are now constrained to the screen. 606 * `Context::begin_frame()` no longer returns a `Ui`. Instead put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`. 607 * `Context::end_frame()` now returns shapes that need to be converted to triangles with `Context::tessellate()`. 608 * Anti-aliasing is now off by default in debug builds. 609 610 ### Removed 🔥 611 612 * You can no longer throw windows. 613 614 ### Fixed 🐛 615 * Fix a bug where some regions would slowly grow for non-integral scales (`pixels_per_point`). 616 617 618 ## 0.2.0 - 2020-10-10 619 620 * Color picker 621 * Unicode characters in labels (limited by [what the default font supports](https://fonts.google.com/specimen/Comfortaa#glyphs)) 622 * Simple drop-down combo box menu 623 * Logarithmic sliders 624 * Optimization: coarse culling in the tessellator 625 * CHANGED: switch argument order of `ui.checkbox` and `ui.radio` 626 627 628 ## 0.1.4 - 2020-09-08 629 630 This is when I started the CHANGELOG.md, after almost two years of development. Better late than never. 631 632 * Widgets: label, text button, hyperlink, checkbox, radio button, slider, draggable value, text editing 633 * Layouts: horizontal, vertical, columns 634 * Text input: very basic, multiline, copy/paste 635 * Windows: move, resize, name, minimize and close. Automatically sized and positioned. 636 * Regions: resizing, vertical scrolling, collapsing headers (sections) 637 * Rendering: Anti-aliased rendering of lines, circles, text and convex polygons. 638 * Tooltips on hover 639 640 641 ## Earlier: 642 643 * 2020-08-10: renamed the project to "egui" 644 * 2020-05-30: first release on crates.io (0.1.0) 645 * 2020-04-01: serious work starts (pandemic project) 646 * 2019-03-12: gave a talk about what would later become egui: https://www.youtube.com/watch?v=-pmwLHw5Gbs 647 * 2018-12-23: [initial commit](https://github.com/emilk/egui/commit/856bbf4dae4a69693a0324da34e8b0dd3754dfdf) 648 * 2018-11-04: started tinkering on a train