Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to egui trunk #5219

Merged
merged 4 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 29 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ debug = true
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

# ecolor = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
# eframe = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
# egui = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
# egui_extras = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
# egui_plot = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
# egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
# emath = { git = "https://github.com/emilk/egui.git", rev = "74f00f9017781d193bca6142ce764b6dd32a0e6f" } # egui master 2024-02-05
ecolor = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
eframe = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
egui = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27
emath = { git = "https://github.com/emilk/egui.git", rev = "e8af6f38fcebcc889963e86c4a3ccebe97db1908" } # egui master 2024-02-27

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand All @@ -301,6 +301,6 @@ debug = true
# egui-wgpu = { path = "../../egui/crates/egui-wgpu" }
# emath = { path = "../../egui/crates/emath" }

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

# 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
2 changes: 1 addition & 1 deletion crates/re_space_view_spatial/src/ui_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ pub fn view_2d(
SpatialSpaceViewKind::TwoD,
);

if !re_ui::egui_helpers::is_anything_being_dragged(ui.ctx()) {
if ui.ctx().dragged_id().is_none() {
response = picking(
ctx,
response,
Expand Down
2 changes: 1 addition & 1 deletion crates/re_space_view_spatial/src/ui_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ pub fn view_3d(
SpatialSpaceViewKind::ThreeD,
);

if !re_ui::egui_helpers::is_anything_being_dragged(ui.ctx()) {
if ui.ctx().dragged_id().is_none() {
response = picking(
ctx,
response,
Expand Down
2 changes: 1 addition & 1 deletion crates/re_space_view_tensor/src/tensor_dimension_mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn tensor_dimension_ui(
) {
let frame = egui::Frame::default().inner_margin(4.0);

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

if let Some(dim_idx) = bound_dim_idx {
Expand Down
2 changes: 1 addition & 1 deletion crates/re_time_panel/src/data_density_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ pub fn data_density_graph_ui(
ctx.selection_state().set_selection(item.to_item());
time_ctrl.set_time(hovered_time_range.min);
time_ctrl.pause();
} else if !ui.ctx().memory(|mem| mem.is_anything_being_dragged()) {
} else if ui.ctx().dragged_id().is_none() {
show_row_ids_tooltip(
ctx,
time_ctrl,
Expand Down
4 changes: 2 additions & 2 deletions crates/re_time_panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ fn time_marker_ui(
let time_drag_id = ui.id().with("time_drag_id");
let timeline_cursor_icon = CursorIcon::ResizeHorizontal;
let is_hovering_the_loop_selection = ui.output(|o| o.cursor_icon) != CursorIcon::Default; // A kind of hacky proxy
let is_anything_being_dragged = ui.memory(|mem| mem.is_anything_being_dragged());
let is_anything_being_dragged = ui.ctx().dragged_id().is_some();
let interact_radius = ui.style().interaction.resize_grab_radius_side;

let mut is_hovering_time_cursor = false;
Expand Down Expand Up @@ -1344,7 +1344,7 @@ fn time_marker_ui(
let time = time_ranges_ui.clamp_time(time);
time_ctrl.set_time(time);
time_ctrl.pause();
ui.memory_mut(|mem| mem.set_dragged_id(time_drag_id));
ui.ctx().set_dragged_id(time_drag_id); // act as if the user grabbed the time marker cursor
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions crates/re_time_panel/src/time_selection_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub fn loop_selection_ui(
}
}

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

// Start new selection?
if let Some(pointer_pos) = pointer_pos {
let is_anything_being_dragged = ui.memory(|mem| mem.is_anything_being_dragged());
let is_anything_being_dragged = ui.ctx().dragged_id().is_some();
if is_pointer_in_timeline
&& !is_anything_being_dragged
&& ui.input(|i| i.pointer.primary_down() && i.modifiers.shift_only())
{
if let Some(time) = time_ranges_ui.time_from_x_f32(pointer_pos.x) {
time_ctrl.set_loop_selection(TimeRangeF::point(time));
time_ctrl.set_looping(Looping::Selection);
ui.memory_mut(|mem| mem.set_dragged_id(right_edge_id));
ui.ctx().set_dragged_id(right_edge_id);
}
}
}
Expand Down Expand Up @@ -226,7 +226,7 @@ fn drag_right_loop_selection_edge(

if selected_range.min > selected_range.max {
std::mem::swap(&mut selected_range.min, &mut selected_range.max);
ui.memory_mut(|mem| mem.set_dragged_id(right_edge_id));
ui.ctx().set_dragged_id(right_edge_id);
}

Some(())
Expand Down Expand Up @@ -254,7 +254,7 @@ fn drag_left_loop_selection_edge(

if selected_range.min > selected_range.max {
std::mem::swap(&mut selected_range.min, &mut selected_range.max);
ui.memory_mut(|mem| mem.set_dragged_id(left_edge_id));
ui.ctx().set_dragged_id(left_edge_id);
}

Some(())
Expand Down
19 changes: 0 additions & 19 deletions crates/re_ui/src/egui_helpers.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/re_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ mod command;
mod command_palette;
mod design_tokens;
pub mod drag_and_drop;
pub mod egui_helpers;
pub mod icons;
mod layout_job_builder;
pub mod list_item;
Expand Down
4 changes: 0 additions & 4 deletions crates/re_viewer/src/ui/rerun_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,6 @@ fn egui_debug_options_ui(re_ui: &re_ui::ReUi, ui: &mut egui::Ui) {
)
.on_hover_text("Show an overlay on all interactive widgets")
.changed();
any_clicked |= re_ui
.checkbox(ui, &mut debug.show_blocking_widget, "Show blocking widgets")
.on_hover_text("Show what widget blocks the interaction of another widget")
.changed();

if any_clicked {
let mut style = (*ui.ctx().style()).clone();
Expand Down
Loading