fixing alignment issues
This commit is contained in:
parent
a80ab8e9a6
commit
803f892e7e
|
@ -607,6 +607,7 @@ impl cosmic::Application for App {
|
||||||
Container::new(
|
Container::new(
|
||||||
self.presenter.view_preview().map(Message::Present),
|
self.presenter.view_preview().map(Message::Present),
|
||||||
)
|
)
|
||||||
|
.height(250)
|
||||||
.align_bottom(Length::Fill),
|
.align_bottom(Length::Fill),
|
||||||
Container::new(if self.presenter.video.is_some() {
|
Container::new(if self.presenter.video.is_some() {
|
||||||
row![
|
row![
|
||||||
|
|
|
@ -9,7 +9,6 @@ use cosmic::{
|
||||||
Background, Border, Color, ContentFit, Font, Length, Shadow,
|
Background, Border, Color, ContentFit, Font, Length, Shadow,
|
||||||
Vector,
|
Vector,
|
||||||
},
|
},
|
||||||
iced_core::text::Span,
|
|
||||||
iced_widget::{
|
iced_widget::{
|
||||||
rich_text,
|
rich_text,
|
||||||
scrollable::{
|
scrollable::{
|
||||||
|
@ -544,7 +543,6 @@ pub(crate) fn slide_view<'a>(
|
||||||
hide_mouse: bool,
|
hide_mouse: bool,
|
||||||
) -> Element<'a, Message> {
|
) -> Element<'a, Message> {
|
||||||
responsive(move |size| {
|
responsive(move |size| {
|
||||||
let height = size.width * 9.0 / 16.0;
|
|
||||||
let width = size.height * 16.0 / 9.0;
|
let width = size.height * 16.0 / 9.0;
|
||||||
let font_size = scale_font(slide.font_size() as f32, width);
|
let font_size = scale_font(slide.font_size() as f32, width);
|
||||||
let slide_text = slide.text();
|
let slide_text = slide.text();
|
||||||
|
@ -573,7 +571,7 @@ pub(crate) fn slide_view<'a>(
|
||||||
})
|
})
|
||||||
.clip(true)
|
.clip(true)
|
||||||
.width(width)
|
.width(width)
|
||||||
.height(height);
|
.height(size.height);
|
||||||
let container = match slide.background().kind {
|
let container = match slide.background().kind {
|
||||||
BackgroundKind::Image => {
|
BackgroundKind::Image => {
|
||||||
let path = slide.background().path.clone();
|
let path = slide.background().path.clone();
|
||||||
|
@ -581,7 +579,7 @@ pub(crate) fn slide_view<'a>(
|
||||||
image(path)
|
image(path)
|
||||||
.content_fit(ContentFit::Cover)
|
.content_fit(ContentFit::Cover)
|
||||||
.width(width)
|
.width(width)
|
||||||
.height(height),
|
.height(size.height),
|
||||||
)
|
)
|
||||||
.center(Length::Shrink)
|
.center(Length::Shrink)
|
||||||
.clip(true)
|
.clip(true)
|
||||||
|
@ -595,7 +593,7 @@ pub(crate) fn slide_view<'a>(
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
.center_x(width)
|
.center_x(width)
|
||||||
.center_y(height)
|
.center_y(size.height)
|
||||||
.clip(true)
|
.clip(true)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.height(Length::Fill)
|
.height(Length::Fill)
|
||||||
|
@ -604,7 +602,7 @@ pub(crate) fn slide_view<'a>(
|
||||||
VideoPlayer::new(video)
|
VideoPlayer::new(video)
|
||||||
.mouse_hidden(hide_mouse)
|
.mouse_hidden(hide_mouse)
|
||||||
.width(width)
|
.width(width)
|
||||||
.height(height)
|
.height(size.height)
|
||||||
.on_end_of_stream(Message::EndVideo)
|
.on_end_of_stream(Message::EndVideo)
|
||||||
.on_new_frame(Message::VideoFrame)
|
.on_new_frame(Message::VideoFrame)
|
||||||
.on_missing_plugin(Message::MissingPlugin)
|
.on_missing_plugin(Message::MissingPlugin)
|
||||||
|
@ -623,9 +621,14 @@ pub(crate) fn slide_view<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
stack!(black, container.center(Length::Fill), text_container)
|
let stack = stack!(
|
||||||
.width(width)
|
black,
|
||||||
.height(height)
|
container.center(Length::Fill),
|
||||||
|
text_container
|
||||||
|
);
|
||||||
|
Container::new(stack)
|
||||||
|
.center_x(Length::Fill)
|
||||||
|
.center_y(size.height)
|
||||||
.into()
|
.into()
|
||||||
})
|
})
|
||||||
.into()
|
.into()
|
||||||
|
|
|
@ -178,7 +178,7 @@ impl SongEditor {
|
||||||
.map(|_| Message::None),
|
.map(|_| Message::None),
|
||||||
)
|
)
|
||||||
.height(250)
|
.height(250)
|
||||||
.center_x(Length::Shrink)
|
.center_x(Length::Fill)
|
||||||
.padding([0, 20])
|
.padding([0, 20])
|
||||||
.clip(true)
|
.clip(true)
|
||||||
.into()
|
.into()
|
||||||
|
|
Loading…
Reference in a new issue