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

Nicer (& fixed up) help texts for space views #2070

Merged
merged 6 commits into from May 15, 2023
Merged

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented May 9, 2023

Introduced a little utility for this purpose. Not very well-rounded, but a good starting point I like to think :)

Help texts for different space views:

3D:
image

2D:
image

Bar chart:
image

Time series:
image

Checklist

@Wumpf Wumpf added enhancement New feature or request ui concerns graphical user interface 📺 re_viewer affects re_viewer itself labels May 9, 2023
@Wumpf
Copy link
Member Author

Wumpf commented May 9, 2023

on the 3D it says holding alt instead of holding option despite me being on a mac.
emilk/egui#2981 fixes this!

@Wumpf Wumpf force-pushed the andreas/nicer-help-text branch from 7050b40 to c6c62cd Compare May 9, 2023 14:26
Comment on lines 241 to 248
pub fn help_text(re_ui: &re_ui::ReUi) -> egui::WidgetText {
let pan_mouse = egui::PointerButton::Secondary;
let roll_mouse = egui::PointerButton::Middle;
let roll_mouse_alt = egui::PointerButton::Primary;
let roll_modifier = egui::Modifiers::ALT;
let speed_up = egui::Modifiers::SHIFT;
let slow_down = egui::Modifiers::CTRL;
let restore_key = egui::Key::Escape;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if these semantic constants were shared with the values used here:

pub fn update(&mut self, response: &egui::Response, drag_threshold: f32) -> bool {
let mut did_interact = false;
if response.drag_delta().length() > drag_threshold {
if response.dragged_by(egui::PointerButton::Middle)
|| (response.dragged_by(egui::PointerButton::Primary)
&& response.ctx.input(|i| i.modifiers.alt))
{
if let Some(pointer_pos) = response.ctx.pointer_latest_pos() {
self.roll(&response.rect, pointer_pos, response.drag_delta());
did_interact = true;
}
} else if response.dragged_by(egui::PointerButton::Primary) {
self.rotate(response.drag_delta());
did_interact = true;
} else if response.dragged_by(egui::PointerButton::Secondary) {
self.translate(response.drag_delta());
did_interact = true;
}
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was too lazy to go that extra mile, but yeah at least some of those are pretty easy. Let's put them somewhere central!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be nice

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done that now. Sadly lots of controls are hidden inside other egui constructs like scrollview or plot

@Wumpf Wumpf merged commit 86adc26 into main May 15, 2023
15 checks passed
@Wumpf Wumpf deleted the andreas/nicer-help-text branch May 15, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 📺 re_viewer affects re_viewer itself ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants