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

Improve welcome screen for small screens #6421

Merged
merged 5 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 5 additions & 3 deletions crates/re_time_panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ impl TimePanel {
) {
ui.spacing_mut().item_spacing.x = 18.0; // from figma

if ui.max_rect().width() < 600.0 {
let has_any_data_on_timeline = entity_db.has_any_data_on_timeline(time_ctrl.timeline());

if ui.max_rect().width() < 600.0 && has_any_data_on_timeline {
// Responsive ui for narrow screens, e.g. mobile. Split the controls into two rows.
ui.vertical(|ui| {
ui.horizontal(|ui| {
Expand All @@ -273,7 +275,7 @@ impl TimePanel {
self.time_control_ui
.play_pause_ui(time_ctrl, re_ui, times_per_timeline, ui);

if entity_db.has_any_data_on_timeline(time_ctrl.timeline()) {
if has_any_data_on_timeline {
self.time_control_ui.playback_speed_ui(time_ctrl, ui);
self.time_control_ui.fps_ui(time_ctrl, ui);
}
Expand All @@ -296,7 +298,7 @@ impl TimePanel {
self.time_control_ui
.timeline_selector_ui(time_ctrl, times_per_timeline, ui);

if entity_db.has_any_data_on_timeline(time_ctrl.timeline()) {
if has_any_data_on_timeline {
self.time_control_ui.playback_speed_ui(time_ctrl, ui);
self.time_control_ui.fps_ui(time_ctrl, ui);
}
Expand Down
11 changes: 6 additions & 5 deletions crates/re_viewer/src/app_blueprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use re_log_types::{DataRow, EntityPath, RowId};
use re_types::blueprint::components::PanelState;
use re_viewer_context::{CommandSender, StoreContext, SystemCommand, SystemCommandSender};

pub const TOP_PANEL_PATH: &str = "top_panel";
pub const BLUEPRINT_PANEL_PATH: &str = "blueprint_panel";
pub const SELECTION_PANEL_PATH: &str = "selection_panel";
pub const TIME_PANEL_PATH: &str = "time_panel";
const TOP_PANEL_PATH: &str = "top_panel";
const BLUEPRINT_PANEL_PATH: &str = "blueprint_panel";
const SELECTION_PANEL_PATH: &str = "selection_panel";
const TIME_PANEL_PATH: &str = "time_panel";

/// Blueprint for top-level application
pub struct AppBlueprint<'a> {
Expand Down Expand Up @@ -98,9 +98,10 @@ impl<'a> AppBlueprint<'a> {
}

pub fn setup_welcome_screen_blueprint(welcome_screen_blueprint: &mut EntityDb) {
// Most things are hidden in the welcome screen:
for (panel_name, value) in [
(TOP_PANEL_PATH, PanelState::Expanded),
(BLUEPRINT_PANEL_PATH, PanelState::Expanded),
(BLUEPRINT_PANEL_PATH, PanelState::Hidden),
(SELECTION_PANEL_PATH, PanelState::Hidden),
(TIME_PANEL_PATH, PanelState::Hidden),
] {
Expand Down
5 changes: 4 additions & 1 deletion crates/re_viewer/src/ui/welcome_screen/example_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ pub(super) const MIN_COLUMN_WIDTH: f32 = 250.0;
const MAX_COLUMN_WIDTH: f32 = 337.0;
const MAX_COLUMN_COUNT: usize = 3;
const COLUMN_HSPACE: f32 = 20.0;
const TITLE_TO_GRID_VSPACE: f32 = 32.0;
const AFTER_HEADER_VSPACE: f32 = 48.0;
const TITLE_TO_GRID_VSPACE: f32 = 24.0;
const ROW_VSPACE: f32 = 20.0;
const THUMBNAIL_RADIUS: f32 = 12.0;

Expand Down Expand Up @@ -274,6 +275,8 @@ impl ExampleSection {
ui.vertical(|ui| {
header_ui(ui);

ui.add_space(AFTER_HEADER_VSPACE);

let Some(examples) = examples.ready_mut() else {
// Still waiting for example to load
ui.separator();
Expand Down
4 changes: 1 addition & 3 deletions crates/re_viewer/src/ui/welcome_screen/welcome_section.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use egui::Ui;

pub(super) const DOCS_URL: &str = "https://www.rerun.io/docs";
pub(super) const WELCOME_SCREEN_TITLE: &str = "Visualize Multimodal Data";
pub(super) const WELCOME_SCREEN_TITLE: &str = "Visualize multimodal data";
pub(super) const WELCOME_SCREEN_BULLET_TEXT: &[&str] = &[
"Log data with the Rerun SDK in C++, Python, or Rust",
"Visualize and explore live or recorded data",
Expand Down Expand Up @@ -65,7 +65,5 @@ pub(super) fn welcome_section_ui(ui: &mut egui::Ui) {
new_tab: true,
});
}

ui.add_space(83.0);
});
}
Loading