ui-widgets: the link-in-a-sentence story fits its room at every text size

At 379 points in a 400-point room it wrapped under the large text size and came out narrower. With no closing stop
its width is the same in both directions.
This commit is contained in:
bflatastic committed 2026-11-22 08:18:31 +07:00
1 parent ad0ab4b9c3
commit fe8ebb2748
1 file changed
+4 -3
+4 -3
View File
@@ -432,13 +432,14 @@ fn button_with_detail(ui: &mut Ui, _: &mut StoryData) -> StoryOutput {
Button::new("Quick start").icon(IconId::new("eye")).detail("Learn the basics of drawing in five minutes").show(ui).into()
}
/// A link inside a sentence.
/// A link inside a sentence short enough to stay on one line at every text size. It has no closing stop: a neutral
/// end moves under right-to-left and changes the run's width.
#[story(Link, covers = [], drive = Drive::Never, title = "In a sentence")]
fn link_in_sentence(ui: &mut Ui, _: &mut StoryData) -> StoryOutput {
let shown = Row::new().show(ui, |ui, _| {
Text::new("Every shortcut is listed in").show(ui);
Text::new("See").show(ui);
Link::new("the shortcuts guide").url("https://example.com/shortcuts").id_salt("guide").show(ui);
Text::new("and can be changed.").show(ui);
Text::new("to change a key").show(ui);
});
shown.into()
}