From 355969c4f7b908f2ba443d3d8df581b07a3a7e66 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 6 Sep 2023 10:12:37 +0200 Subject: [PATCH] Spacing update + no URL tooltip --- crates/re_viewer/src/ui/welcome_screen/mod.rs | 1 - .../src/ui/welcome_screen/welcome_page.rs | 14 +++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/re_viewer/src/ui/welcome_screen/mod.rs b/crates/re_viewer/src/ui/welcome_screen/mod.rs index 7c6c0e8d6638..90ff3557944b 100644 --- a/crates/re_viewer/src/ui/welcome_screen/mod.rs +++ b/crates/re_viewer/src/ui/welcome_screen/mod.rs @@ -150,7 +150,6 @@ fn url_large_text_button( if egui::Button::image_and_text(texture_id, ReUi::small_icon_size(), text) .ui(ui) .on_hover_cursor(egui::CursorIcon::PointingHand) - .on_hover_text(url) .clicked() { ui.ctx().output_mut(|o| { diff --git a/crates/re_viewer/src/ui/welcome_screen/welcome_page.rs b/crates/re_viewer/src/ui/welcome_screen/welcome_page.rs index 9aa88677ce20..f24ecf30dcc0 100644 --- a/crates/re_viewer/src/ui/welcome_screen/welcome_page.rs +++ b/crates/re_viewer/src/ui/welcome_screen/welcome_page.rs @@ -115,7 +115,7 @@ fn onboarding_content_ui( const MAX_COLUMN_WIDTH: f32 = 255.0; const MIN_COLUMN_WIDTH: f32 = 164.0; - let grid_spacing = egui::vec2(12.0, 12.0); + let grid_spacing = egui::vec2(12.0, 16.0); let mut column_count = (((ui.available_width() + grid_spacing.x) / (MIN_COLUMN_WIDTH + grid_spacing.x)) @@ -147,16 +147,18 @@ fn onboarding_content_ui( ui.add(egui::Label::new( egui::RichText::new("Welcome.") .strong() + .line_height(Some(32.0)) .text_style(re_ui::ReUi::welcome_screen_h1()), )); ui.add(egui::Label::new( egui::RichText::new("Visualize multimodal data.") + .line_height(Some(32.0)) .text_style(re_ui::ReUi::welcome_screen_h1()), )); }); - ui.add_space(20.0); + ui.add_space(32.0); let grid = egui::Grid::new("welcome_screen_grid") .spacing(grid_spacing) @@ -181,8 +183,13 @@ fn onboarding_content_ui( ui.end_row(); - for panel in panels { + for (idx, panel) in panels.iter().enumerate() { ui.vertical(|ui| { + // don't let the text get too close to the right-hand content, if any + if (idx + 1) % column_count != 0 { + ui.set_max_width(column_width - 8.0); + } + ui.label( egui::RichText::new(panel.title) .strong() @@ -196,6 +203,7 @@ fn onboarding_content_ui( for panel in panels { ui.horizontal(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; if (panel.add_buttons)(ui) { show_example = true; }