Skip to content

Commit 9c4a9b4

Browse files
authored
Update to egui trunk (#5219)
### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/5219/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5219/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/5219/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/5219) - [Docs preview](https://rerun.io/preview/e17b0cd46fa8869f31c67274619c3416fdf6ca14/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/e17b0cd46fa8869f31c67274619c3416fdf6ca14/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
1 parent 3f881ab commit 9c4a9b4

File tree

11 files changed

+33
-68
lines changed

11 files changed

+33
-68
lines changed

Cargo.lock

+13-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ criterion = "0.5"
126126
crossbeam = "0.8"
127127
directories-next = "2"
128128
document-features = "0.2.8"
129-
ehttp = "0.4.0"
129+
ehttp = "0.5.0"
130130
enumset = "1.0.12"
131131
env_logger = { version = "0.10", default-features = false }
132132
ewebsock = "0.5.0"
@@ -284,13 +284,13 @@ debug = true
284284
# As a last resport, patch with a commit to our own repository.
285285
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.
286286

287-
# ecolor = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
288-
# eframe = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
289-
# egui = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
290-
# egui_extras = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
291-
# egui_plot = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
292-
# egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
293-
# emath = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
287+
ecolor = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
288+
eframe = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
289+
egui = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
290+
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
291+
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
292+
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
293+
emath = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
294294

295295
# Useful while developing:
296296
# ecolor = { path = "../../egui/crates/ecolor" }
@@ -301,6 +301,6 @@ debug = true
301301
# egui-wgpu = { path = "../../egui/crates/egui-wgpu" }
302302
# emath = { path = "../../egui/crates/emath" }
303303

304-
# egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "50732cf58528b7060844915bdbcb47a3b0d4d07e" } # master 2024-02-06
304+
egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "6147feb6f9e6a60e8f12872398d449baa6e0b2ec" } # main 2024-02-27, which works with egui master
305305

306306
# egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark", rev = "3d83a92f995a1d18ab1172d0b129d496e0eedaae" } # Update to egui 0.25 https://github.com/lampsitter/egui_commonmark/pull/27

crates/re_space_view_spatial/src/ui_2d.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ pub fn view_2d(
324324
SpatialSpaceViewKind::TwoD,
325325
);
326326

327-
if !re_ui::egui_helpers::is_anything_being_dragged(ui.ctx()) {
327+
if ui.ctx().dragged_id().is_none() {
328328
response = picking(
329329
ctx,
330330
response,

crates/re_space_view_spatial/src/ui_3d.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ pub fn view_3d(
529529
SpatialSpaceViewKind::ThreeD,
530530
);
531531

532-
if !re_ui::egui_helpers::is_anything_being_dragged(ui.ctx()) {
532+
if ui.ctx().dragged_id().is_none() {
533533
response = picking(
534534
ctx,
535535
response,

crates/re_space_view_tensor/src/tensor_dimension_mapper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn tensor_dimension_ui(
6363
) {
6464
let frame = egui::Frame::default().inner_margin(4.0);
6565

66-
let (_response, dropped) = ui.dnd_drop_zone::<DragDropAddress>(frame, |ui| {
66+
let (_response, dropped) = ui.dnd_drop_zone::<DragDropAddress, _>(frame, |ui| {
6767
ui.set_min_size(egui::vec2(80., 15.));
6868

6969
if let Some(dim_idx) = bound_dim_idx {

crates/re_time_panel/src/data_density_graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ pub fn data_density_graph_ui(
490490
ctx.selection_state().set_selection(item.to_item());
491491
time_ctrl.set_time(hovered_time_range.min);
492492
time_ctrl.pause();
493-
} else if !ui.ctx().memory(|mem| mem.is_anything_being_dragged()) {
493+
} else if ui.ctx().dragged_id().is_none() {
494494
show_row_ids_tooltip(
495495
ctx,
496496
time_ctrl,

crates/re_time_panel/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ fn time_marker_ui(
12741274
let time_drag_id = ui.id().with("time_drag_id");
12751275
let timeline_cursor_icon = CursorIcon::ResizeHorizontal;
12761276
let is_hovering_the_loop_selection = ui.output(|o| o.cursor_icon) != CursorIcon::Default; // A kind of hacky proxy
1277-
let is_anything_being_dragged = ui.memory(|mem| mem.is_anything_being_dragged());
1277+
let is_anything_being_dragged = ui.ctx().dragged_id().is_some();
12781278
let interact_radius = ui.style().interaction.resize_grab_radius_side;
12791279

12801280
let mut is_hovering_time_cursor = false;
@@ -1344,7 +1344,7 @@ fn time_marker_ui(
13441344
let time = time_ranges_ui.clamp_time(time);
13451345
time_ctrl.set_time(time);
13461346
time_ctrl.pause();
1347-
ui.memory_mut(|mem| mem.set_dragged_id(time_drag_id));
1347+
ui.ctx().set_dragged_id(time_drag_id); // act as if the user grabbed the time marker cursor
13481348
}
13491349
}
13501350
}

crates/re_time_panel/src/time_selection_ui.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pub fn loop_selection_ui(
134134
}
135135
}
136136

137-
if selected_range.is_empty() && !ui.memory(|mem| mem.is_anything_being_dragged()) {
137+
if selected_range.is_empty() && ui.ctx().dragged_id().is_none() {
138138
// A zero-sized loop selection is confusing (and invisible), so remove it
139139
// (unless we are in the process of dragging right now):
140140
time_ctrl.remove_loop_selection();
@@ -146,15 +146,15 @@ pub fn loop_selection_ui(
146146

147147
// Start new selection?
148148
if let Some(pointer_pos) = pointer_pos {
149-
let is_anything_being_dragged = ui.memory(|mem| mem.is_anything_being_dragged());
149+
let is_anything_being_dragged = ui.ctx().dragged_id().is_some();
150150
if is_pointer_in_timeline
151151
&& !is_anything_being_dragged
152152
&& ui.input(|i| i.pointer.primary_down() && i.modifiers.shift_only())
153153
{
154154
if let Some(time) = time_ranges_ui.time_from_x_f32(pointer_pos.x) {
155155
time_ctrl.set_loop_selection(TimeRangeF::point(time));
156156
time_ctrl.set_looping(Looping::Selection);
157-
ui.memory_mut(|mem| mem.set_dragged_id(right_edge_id));
157+
ui.ctx().set_dragged_id(right_edge_id);
158158
}
159159
}
160160
}
@@ -226,7 +226,7 @@ fn drag_right_loop_selection_edge(
226226

227227
if selected_range.min > selected_range.max {
228228
std::mem::swap(&mut selected_range.min, &mut selected_range.max);
229-
ui.memory_mut(|mem| mem.set_dragged_id(right_edge_id));
229+
ui.ctx().set_dragged_id(right_edge_id);
230230
}
231231

232232
Some(())
@@ -254,7 +254,7 @@ fn drag_left_loop_selection_edge(
254254

255255
if selected_range.min > selected_range.max {
256256
std::mem::swap(&mut selected_range.min, &mut selected_range.max);
257-
ui.memory_mut(|mem| mem.set_dragged_id(left_edge_id));
257+
ui.ctx().set_dragged_id(left_edge_id);
258258
}
259259

260260
Some(())

crates/re_ui/src/egui_helpers.rs

-19
This file was deleted.

crates/re_ui/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ mod command;
44
mod command_palette;
55
mod design_tokens;
66
pub mod drag_and_drop;
7-
pub mod egui_helpers;
87
pub mod icons;
98
mod layout_job_builder;
109
pub mod list_item;

crates/re_viewer/src/ui/rerun_menu.rs

-4
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,6 @@ fn egui_debug_options_ui(re_ui: &re_ui::ReUi, ui: &mut egui::Ui) {
428428
)
429429
.on_hover_text("Show an overlay on all interactive widgets")
430430
.changed();
431-
any_clicked |= re_ui
432-
.checkbox(ui, &mut debug.show_blocking_widget, "Show blocking widgets")
433-
.on_hover_text("Show what widget blocks the interaction of another widget")
434-
.changed();
435431

436432
if any_clicked {
437433
let mut style = (*ui.ctx().style()).clone();

0 commit comments

Comments
 (0)