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

Collapse panels #238

Merged
merged 11 commits into from
Oct 31, 2022
Merged

Collapse panels #238

merged 11 commits into from
Oct 31, 2022

Conversation

emilk
Copy link
Member

@emilk emilk commented Oct 28, 2022

See also emilk/egui#2190

collapsing-panels-hd

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I've added a line to CHANGELOG.md (if this is a big enough change to warrant it)

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

feature looks great and wasn't able to break it
But some concerns about the code. In particular I do think we need a better story for displaying shortcuts!

None of my comments is blocking though

crates/re_viewer/src/app.rs Show resolved Hide resolved
@@ -689,27 +708,19 @@ fn file_menu(ui: &mut egui::Ui, app: &mut App, _frame: &mut eframe::Frame) {
ui.menu_button("Advanced", |ui| {
Copy link
Member

Choose a reason for hiding this comment

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

not a great place for such a fundamental view operation. should go to a View menu. But that can ofc wait

ui.close_menu();
}

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
if ui
.button("Profile viewer")
.on_hover_text("Starts a profiler, showing what makes the viewer run slow")
.on_hover_text("Starts a profiler, showing what makes the viewer run slow (⌘⇧P or ⌃⇧P)")
Copy link
Member

Choose a reason for hiding this comment

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

do we have a way generate these strings from the set shortcut? I mean at least soemthing like format!("Starts a profiler, showing what makes the viewer run slow ({} or {})", get_puffin_shortcut().as_string(), get_puffin_alt_shortcut().as_string())

Also, more importantly neiother ⌘ nor ⌃ makes much sense to a windows user!

Copy link
Member

Choose a reason for hiding this comment

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

(applies to all shortcut strings ofc)

Copy link
Member Author

@emilk emilk Oct 30, 2022

Choose a reason for hiding this comment

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

One problem is that different platforms use different standards for showing shortcuts

  • ⇧⌘P-style is standard on MacOS
  • I believe Shift+Ctrl+P is standard on Windows?
  • On Linux I have no idea.

The further problem is that when running on Web it's difficult to know what platform we are running on (but I could add some detection code to egui_web that does its best).

Another problem is that on Mac it is more convenient/natural to use ⌘ Command while on Windows Ctrl is more natural.

Maybe @martenbjork has a suggestion here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I have a pretty good plan now. I'll use the user-agent to detect Mac, If mac, I'll show the shortcut as "⇧⌘P", and else as "Ctrl+Shift+P", but I'll save that improvement for a separate PR.

crates/re_viewer/src/ui/time_panel.rs Show resolved Hide resolved
Comment on lines +516 to +518
pub blueprint_panel_expanded: bool,
pub selection_panel_expanded: bool,
pub time_panel_expanded: bool,
Copy link
Member

Choose a reason for hiding this comment

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

is this conceptually really part of the blueprint? It's not like we want to configure it there 🤔

Copy link
Member

Choose a reason for hiding this comment

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

if it is, then maybe the menu button for reset should be somewhere in the blueprint panel

Copy link
Member Author

Choose a reason for hiding this comment

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

is this conceptually really part of the blueprint? It's not like we want to configure it there

As the docstring says, the plan is for the Blueprint to define the layout of the whole Viewer. But we're not there yet. The plan is that we can select any element in the blueprint panel, then change its options in the selection panel.

Copy link
Member Author

Choose a reason for hiding this comment

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

…but we can't/won't add everything in one PR. There is some UI design work needed first.

@emilk emilk merged commit 256142d into main Oct 31, 2022
@emilk emilk deleted the collapse-panels branch October 31, 2022 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants