-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the default UI when the welcome screen is hidden (#6287)
### What Follow-up of #6262 to improve the default UI when the welcome screen is disabled and no recordings are loaded. - Fixes #6263 <img width="1522" alt="image" src="https://github.com/rerun-io/rerun/assets/49431240/ce7355e3-2aad-4171-9187-cda18df8aeaa"> ### 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 examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6287?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6287?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/6287) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
- Loading branch information
Showing
7 changed files
with
148 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
use egui::Ui; | ||
|
||
#[derive(Debug, Default, Clone, Copy)] | ||
struct TextSize(egui::Vec2); | ||
|
||
/// Show a minimal welcome section. | ||
pub fn no_data_ui(ui: &mut egui::Ui) { | ||
re_ui::ReUi::center(ui, "no_data_ui_contents", |ui| { | ||
ui.add( | ||
egui::Label::new( | ||
egui::RichText::new(super::welcome_section::WELCOME_SCREEN_TITLE) | ||
.weak() | ||
.line_height(Some(36.0)) | ||
.text_style(re_ui::ReUi::welcome_screen_h2()), | ||
) | ||
.wrap(true), | ||
); | ||
|
||
ui.add_space(10.0); | ||
|
||
let bullet_text = |ui: &mut Ui, text: &str| { | ||
ui.horizontal(|ui| { | ||
ui.add_space(1.0); | ||
re_ui::ReUi::bullet(ui, ui.visuals().weak_text_color()); | ||
ui.add_space(5.0); | ||
ui.add( | ||
egui::Label::new( | ||
egui::RichText::new(text) | ||
.color(ui.visuals().weak_text_color()) | ||
.text_style(re_ui::ReUi::welcome_screen_body()), | ||
) | ||
.wrap(true), | ||
); | ||
}); | ||
ui.add_space(4.0); | ||
}; | ||
|
||
for text in super::welcome_section::WELCOME_SCREEN_BULLET_TEXT { | ||
bullet_text(ui, text); | ||
} | ||
|
||
ui.add_space(9.0); | ||
if ui | ||
.button( | ||
egui::RichText::new("Go to documentation →") | ||
.weak() | ||
.text_style(re_ui::ReUi::welcome_screen_body()), | ||
) | ||
.on_hover_cursor(egui::CursorIcon::PointingHand) | ||
.clicked() | ||
{ | ||
ui.ctx().open_url(egui::output::OpenUrl { | ||
url: super::welcome_section::DOCS_URL.to_owned(), | ||
new_tab: true, | ||
}); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters