Skip to content

Commit

Permalink
Now with flashier ui
Browse files Browse the repository at this point in the history
  • Loading branch information
abey79 committed Dec 3, 2024
1 parent 813c6dc commit ec41447
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,7 @@ impl SpaceViewClass for SpaceViewClassPlaceholder {
}

fn help_markdown(&self, _egui_ctx: &egui::Context) -> String {
"The space view class was not recognized.\n\n\
\
This happens if either the blueprint specifies an invalid space view class or this version \
of the viewer does not know about \
this type.\n\n\
\
**Note**: some views may require a specific Cargo feature to be enabled. In particular, \
the map view requires the `map_view` feature."
.to_owned()
"Placeholder view for unknown space view class".to_owned()
}

fn on_register(
Expand All @@ -56,7 +48,7 @@ impl SpaceViewClass for SpaceViewClassPlaceholder {

fn ui(
&self,
ctx: &ViewerContext<'_>,
_ctx: &ViewerContext<'_>,
ui: &mut egui::Ui,
_state: &mut dyn SpaceViewState,
_query: &ViewQuery<'_>,
Expand All @@ -67,7 +59,15 @@ impl SpaceViewClass for SpaceViewClassPlaceholder {
..Default::default()
}
.show(ui, |ui| {
ui.markdown_ui(&self.help_markdown(ctx.egui_ctx));
ui.warning_label("Unknown space view class");

ui.markdown_ui(
"This happens if either the blueprint specifies an invalid space view class or \
this version of the viewer does not know about this type.\n\n\
\
**Note**: some views may require a specific Cargo feature to be enabled. In \
particular, the map view requires the `map_view` feature.",
);
});

Ok(())
Expand Down

0 comments on commit ec41447

Please sign in to comment.