Skip to content

Craft Anything: understand how any software works, and craft your own.

Rust

Why we ask is shown on the first-run purpose page, not hidden in a hover tip (#106)

BFlatd7281f25e108
diff --git a/crates/ui-egui/src/first_run.rs b/crates/ui-egui/src/first_run.rs
index fddb76ea..37b206f7 100644
--- a/crates/ui-egui/src/first_run.rs
+++ b/crates/ui-egui/src/first_run.rs
@@ -259,9 +259,16 @@ fn purpose(app: &mut CraftApp, ui: &mut Ui, width: f32) {
}
});
ui.add_space(4.0);
- ui.label(RichText::new(tr("Why we ask")).color(t.accent_ink).size(theme::SMALL)).on_hover_text(tr(
- "Looking inside software you own or are allowed to examine is normal and often protected (learning, compatibility, security). Saying why helps you keep to it; it stays on this computer.",
- ));
+ // Shown, not a hover tip in link colour: a click on it did nothing and read as broken (#71).
+ ui.scope(|ui| {
+ ui.set_max_width(width);
+ ui.label(RichText::new(tr("Why we ask")).size(theme::SMALL).color(t.text_dim).strong());
+ ui.label(RichText::new(tr(
+ "Looking inside software you own or are allowed to examine is normal and often protected (learning, compatibility, security). Saying why helps you keep to it; it stays on this computer.",
+ ))
+ .size(theme::SMALL)
+ .color(t.text_dim));
+ });
ui.add_space(14.0);
if widgets::primary(ui, "Continue").clicked() {
app.state.first_run = FirstRunStep::Done;
diff --git a/crates/ui-egui/tests/smoke.rs b/crates/ui-egui/tests/smoke.rs
index 9700cd15..26f8a5b0 100644
--- a/crates/ui-egui/tests/smoke.rs
+++ b/crates/ui-egui/tests/smoke.rs
@@ -45,6 +45,8 @@ fn first_run_walks_through_four_screens() {
h.run_steps(3);
assert_eq!(h.state().state.first_run, FirstRunStep::Purpose);
assert!(h.state().state.backend.is_none());
+ // Why we ask is read on the page, not only on hover (#71).
+ h.get_by_label_contains("Saying why helps you keep to it");
h.get_by_label("I'm learning how things work").click();
h.run_steps(2);
h.get_by_label("Continue").click();