nandi/jolt-nativepublic Fork 0
a20c5b9
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Let a label wrap where the layout wraps

The text styles set `.wrap()` themselves, so a label broke its own text
whenever it was handed less width than it asked for — including inside a
row laid out without wrapping, where the break has nothing to do with the
line running out. In frq's list pane that read as a status saying
"joine/d" and an unread count split down two lines.

Left alone, a Label takes the layout's wrap mode: wrapping in a column,
extending in an unwrapped row, which is what each of these wanted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-08-30T18:38:10-07:00 Browse files
a20c5b9 parent: 2ab40bf
modified crates/vidya-core/src/theme.rs +11 -8
@@ -560,6 +560,13 @@ pub fn status_dot(ui: &mut Ui, theme: &Theme, live: bool) -> Response {
560560 response
561561 }
562562
563+/// The text styles.
564+///
565+/// None of them sets a wrap mode: a `Label` left alone takes the layout's,
566+/// which wraps in a column and extends in a row laid out without wrapping.
567+/// Forcing `.wrap()` instead made a label break its own text whenever a row
568+/// squeezed it — a status reading "joine/d", an unread count split down two
569+/// lines — for want of the width it asked for.
563570 pub fn title(ui: &mut Ui, theme: &Theme, text: &str) {
564571 ui.add(
565572 Label::new(
@@ -567,8 +574,7 @@ pub fn title(ui: &mut Ui, theme: &Theme, text: &str) {
567574 .size(theme.type_scale.title)
568575 .strong()
569576 .color(theme.palette.text),
570- )
571- .wrap(),
577+ ),
572578 );
573579 }
574580
@@ -579,8 +585,7 @@ pub fn title_2(ui: &mut Ui, theme: &Theme, text: &str) {
579585 .size(theme.type_scale.title_2)
580586 .strong()
581587 .color(theme.palette.text),
582- )
583- .wrap(),
588+ ),
584589 );
585590 }
586591
@@ -590,8 +595,7 @@ pub fn body(ui: &mut Ui, theme: &Theme, text: &str) {
590595 RichText::new(text)
591596 .size(theme.type_scale.body)
592597 .color(theme.palette.text),
593- )
594- .wrap(),
598+ ),
595599 );
596600 }
597601
@@ -601,8 +605,7 @@ pub fn dim_label(ui: &mut Ui, theme: &Theme, text: &str) {
601605 RichText::new(text)
602606 .size(theme.type_scale.caption)
603607 .color(theme.palette.text_secondary),
604- )
605- .wrap(),
608+ ),
606609 );
607610 }
608611
@@ -560,6 +560,13 @@ pub fn status_dot(ui: &mut Ui, theme: &Theme, live: bool) -> Response {
560 response560 response
561 }561 }
562 562
563+/// The text styles.
564+///
565+/// None of them sets a wrap mode: a `Label` left alone takes the layout's,
566+/// which wraps in a column and extends in a row laid out without wrapping.
567+/// Forcing `.wrap()` instead made a label break its own text whenever a row
568+/// squeezed it — a status reading "joine/d", an unread count split down two
569+/// lines — for want of the width it asked for.
563 pub fn title(ui: &mut Ui, theme: &Theme, text: &str) {570 pub fn title(ui: &mut Ui, theme: &Theme, text: &str) {
564 ui.add(571 ui.add(
565 Label::new(572 Label::new(
@@ -567,8 +574,7 @@ pub fn title(ui: &mut Ui, theme: &Theme, text: &str) {
567 .size(theme.type_scale.title)574 .size(theme.type_scale.title)
568 .strong()575 .strong()
569 .color(theme.palette.text),576 .color(theme.palette.text),
570- )577+ ),
571- .wrap(),
572 );578 );
573 }579 }
574 580
@@ -579,8 +585,7 @@ pub fn title_2(ui: &mut Ui, theme: &Theme, text: &str) {
579 .size(theme.type_scale.title_2)585 .size(theme.type_scale.title_2)
580 .strong()586 .strong()
581 .color(theme.palette.text),587 .color(theme.palette.text),
582- )588+ ),
583- .wrap(),
584 );589 );
585 }590 }
586 591
@@ -590,8 +595,7 @@ pub fn body(ui: &mut Ui, theme: &Theme, text: &str) {
590 RichText::new(text)595 RichText::new(text)
591 .size(theme.type_scale.body)596 .size(theme.type_scale.body)
592 .color(theme.palette.text),597 .color(theme.palette.text),
593- )598+ ),
594- .wrap(),
595 );599 );
596 }600 }
597 601
@@ -601,8 +605,7 @@ pub fn dim_label(ui: &mut Ui, theme: &Theme, text: &str) {
601 RichText::new(text)605 RichText::new(text)
602 .size(theme.type_scale.caption)606 .size(theme.type_scale.caption)
603 .color(theme.palette.text_secondary),607 .color(theme.palette.text_secondary),
604- )608+ ),
605- .wrap(),
606 );609 );
607 }610 }
608 611