parent
891ad2587e
commit
89721b947d
1 changed files with 45 additions and 12 deletions
|
@ -561,25 +561,61 @@ pub(crate) fn slide_view(
|
||||||
let lines = slide_text.lines();
|
let lines = slide_text.lines();
|
||||||
let text: Vec<Element<Message>> = lines
|
let text: Vec<Element<Message>> = lines
|
||||||
.map(|t| {
|
.map(|t| {
|
||||||
rich_text([span(format!("{}\n", t))
|
let chars = t
|
||||||
|
.chars()
|
||||||
|
.map(
|
||||||
|
|c| -> cosmic::iced_core::text::Span<
|
||||||
|
'_,
|
||||||
|
(),
|
||||||
|
Font,
|
||||||
|
> {
|
||||||
|
span(format!("{}\n", c))
|
||||||
|
.size(font_size)
|
||||||
|
.font(font)
|
||||||
.background(
|
.background(
|
||||||
Background::Color(Color::BLACK)
|
Background::Color(Color::BLACK)
|
||||||
.scale_alpha(0.4),
|
.scale_alpha(0.4),
|
||||||
)
|
)
|
||||||
.border(border::rounded(10))
|
.border(border::rounded(10))
|
||||||
|
.padding(10)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.collect();
|
||||||
|
rich_text(chars).center().into()
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
let text = Column::with_children(text).spacing(26);
|
||||||
|
|
||||||
|
let lines = slide_text.lines();
|
||||||
|
let stroke_text: Vec<Element<Message>> = lines
|
||||||
|
.map(|t| {
|
||||||
|
let mut stroke_font = font.clone();
|
||||||
|
stroke_font.stretch = Stretch::Condensed;
|
||||||
|
stroke_font.weight = Weight::Bold;
|
||||||
|
rich_text([span(format!("{}\n", t))
|
||||||
|
.size(font_size + 0.3)
|
||||||
|
.font(stroke_font)
|
||||||
|
.color(Color::BLACK)
|
||||||
|
.border(border::rounded(10))
|
||||||
.padding(10)])
|
.padding(10)])
|
||||||
.size(font_size)
|
|
||||||
.font(font)
|
|
||||||
.center()
|
.center()
|
||||||
.into()
|
.into()
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let text = Column::with_children(text).spacing(26);
|
let stroke_text =
|
||||||
|
Column::with_children(stroke_text).spacing(26);
|
||||||
|
|
||||||
//Next
|
//Next
|
||||||
let text_container = Container::new(text)
|
let text_container = Container::new(text)
|
||||||
.center(Length::Fill)
|
.center(Length::Fill)
|
||||||
.align_x(Horizontal::Left);
|
.align_x(Horizontal::Left);
|
||||||
|
|
||||||
|
let stroke_text_container = Container::new(stroke_text)
|
||||||
|
.center(Length::Fill)
|
||||||
|
.align_x(Horizontal::Left);
|
||||||
|
|
||||||
|
let text_stack =
|
||||||
|
stack!(stroke_text_container, text_container);
|
||||||
let black = Container::new(Space::new(0, 0))
|
let black = Container::new(Space::new(0, 0))
|
||||||
.style(|_| {
|
.style(|_| {
|
||||||
container::background(Background::Color(Color::BLACK))
|
container::background(Background::Color(Color::BLACK))
|
||||||
|
@ -636,11 +672,8 @@ pub(crate) fn slide_view(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let stack = stack!(
|
let stack =
|
||||||
black,
|
stack!(black, container.center(Length::Fill), text_stack);
|
||||||
container.center(Length::Fill),
|
|
||||||
text_container
|
|
||||||
);
|
|
||||||
Container::new(stack).center(Length::Fill).into()
|
Container::new(stack).center(Length::Fill).into()
|
||||||
})
|
})
|
||||||
.into()
|
.into()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue