egui/crates
v0x0g 1bee7bfefa
Add `Ui::columns_const()` (#4764)
# Changes

- Adds a new function `egui::Ui::columns_const()`, which is the same as
`egui::Ui::columns()` except that it uses a `const` parameter for the
column count.
- Backed by an array `[Ui; NUM_COL] instead of a `Vec<Ui>`, so fewer
allocations
- Inner closure takes in an array reference, instead of a slice
reference. This makes it possible to use pattern destructuring on the
columns, as shown in the example, and makes it more ergonomic to use

# Example

```rust
// ORIGINAL
ui.columns(2, |cols| {
    cols[0].label("one");
    cols[1].label("two");
});


// NEW
ui.columns_const(|[a,b]| {
    a.label("one");
    b.label("two");
});

```

# Checks

- [X] `cargo fmt`
- [X] `cargo clippy`
- [X] `./scripts/check.sh`
- [X] Docs
- [ ] Review
2024-07-15 11:19:34 +02:00
..
ecolor Release 0.28.1 - Tooltip tweaks 2024-07-05 12:09:21 +02:00
eframe eframe: Improve `glow` context switching (#4814) 2024-07-11 11:43:21 +02:00
egui Add `Ui::columns_const()` (#4764) 2024-07-15 11:19:34 +02:00
egui-wgpu `egui-wgpu`: Ensure that `WgpuConfiguration` is `Send + Sync` (#4803) 2024-07-08 23:25:29 +02:00
egui-winit Release 0.28.1 - Tooltip tweaks 2024-07-05 12:09:21 +02:00
egui_demo_app egui_demo_app: include `log::trace` in debug builds 2024-07-01 16:26:20 +02:00
egui_demo_lib Add undo/redo demo. (#4811) 2024-07-15 10:54:34 +02:00
egui_extras Add `TableRow::set_hovered` (#4820) 2024-07-15 10:36:29 +02:00
egui_glow Introduce dithering to reduce banding (#4497) 2024-07-08 09:57:11 +02:00
egui_plot Fix typos (#4796) 2024-07-07 08:50:04 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Document Vec2 constants 2024-07-05 11:39:47 +02:00
epaint epaint: add some missing inline docs (#4815) 2024-07-11 11:52:27 +02:00