iris: make span compaction explicit
This commit is contained in:
1 parent
54e6765a1d
commit
5f4975285d
4 files changed
+90
-19
No files matched your search
+10
-18
@@ -38,24 +38,17 @@ where
|
||||
.add(Srgba8::new(53, 57, 66, 255).to_linear());
|
||||
|
||||
let styled = "Bold, italic, underlined, and colored spans";
|
||||
let styled = wtext(styled)
|
||||
.size(20)
|
||||
.spans(vec![
|
||||
SpanStyle::new(0..4).bold(),
|
||||
SpanStyle::new(6..12).italic(),
|
||||
SpanStyle::new(14..24).underline(),
|
||||
SpanStyle::new(30..37).color(PaintId::SKY),
|
||||
])
|
||||
.width(rest(1));
|
||||
let styled = wtext(styled).size(20).spans(vec![
|
||||
SpanStyle::new(0..4).bold(),
|
||||
SpanStyle::new(6..12).italic(),
|
||||
SpanStyle::new(14..24).underline(),
|
||||
SpanStyle::new(30..37).color(PaintId::SKY),
|
||||
]);
|
||||
|
||||
let aligned = (
|
||||
wtext("Left aligned")
|
||||
.text_align(Align::CENTER_LEFT)
|
||||
.width(rest(1)),
|
||||
wtext("Centered").text_align(Align::CENTER).width(rest(1)),
|
||||
wtext("Right aligned")
|
||||
.text_align(Align::CENTER_RIGHT)
|
||||
.width(rest(1)),
|
||||
wtext("Left aligned").text_align(Align::CENTER_LEFT),
|
||||
wtext("Centered").text_align(Align::CENTER),
|
||||
wtext("Right aligned").text_align(Align::CENTER_RIGHT),
|
||||
)
|
||||
.span(Dir::DOWN)
|
||||
.gap(dp(4))
|
||||
@@ -84,8 +77,7 @@ where
|
||||
.spans(vec![SpanStyle::new(0..9).bold()]),
|
||||
wtext("Drag across display text to select it. The overflow markers select hidden source text, but are never copied.")
|
||||
.overflow(TextOverflow::Wrap)
|
||||
.color(PaintId::GRAY)
|
||||
.width(rest(1)),
|
||||
.color(PaintId::GRAY),
|
||||
)
|
||||
.span(Dir::DOWN)
|
||||
.gap(dp(6))
|
||||
|
||||
Reference in new issue
Block a user