fixing alignment issues

This commit is contained in:
Chris Cochrun 2025-02-26 10:28:08 -06:00
parent a80ab8e9a6
commit 803f892e7e
3 changed files with 14 additions and 10 deletions

View file

@ -607,6 +607,7 @@ impl cosmic::Application for App {
Container::new(
self.presenter.view_preview().map(Message::Present),
)
.height(250)
.align_bottom(Length::Fill),
Container::new(if self.presenter.video.is_some() {
row![

View file

@ -9,7 +9,6 @@ use cosmic::{
Background, Border, Color, ContentFit, Font, Length, Shadow,
Vector,
},
iced_core::text::Span,
iced_widget::{
rich_text,
scrollable::{
@ -544,7 +543,6 @@ pub(crate) fn slide_view<'a>(
hide_mouse: bool,
) -> Element<'a, Message> {
responsive(move |size| {
let height = size.width * 9.0 / 16.0;
let width = size.height * 16.0 / 9.0;
let font_size = scale_font(slide.font_size() as f32, width);
let slide_text = slide.text();
@ -573,7 +571,7 @@ pub(crate) fn slide_view<'a>(
})
.clip(true)
.width(width)
.height(height);
.height(size.height);
let container = match slide.background().kind {
BackgroundKind::Image => {
let path = slide.background().path.clone();
@ -581,7 +579,7 @@ pub(crate) fn slide_view<'a>(
image(path)
.content_fit(ContentFit::Cover)
.width(width)
.height(height),
.height(size.height),
)
.center(Length::Shrink)
.clip(true)
@ -595,7 +593,7 @@ pub(crate) fn slide_view<'a>(
))
})
.center_x(width)
.center_y(height)
.center_y(size.height)
.clip(true)
.width(Length::Fill)
.height(Length::Fill)
@ -604,7 +602,7 @@ pub(crate) fn slide_view<'a>(
VideoPlayer::new(video)
.mouse_hidden(hide_mouse)
.width(width)
.height(height)
.height(size.height)
.on_end_of_stream(Message::EndVideo)
.on_new_frame(Message::VideoFrame)
.on_missing_plugin(Message::MissingPlugin)
@ -623,9 +621,14 @@ pub(crate) fn slide_view<'a>(
}
}
};
stack!(black, container.center(Length::Fill), text_container)
.width(width)
.height(height)
let stack = stack!(
black,
container.center(Length::Fill),
text_container
);
Container::new(stack)
.center_x(Length::Fill)
.center_y(size.height)
.into()
})
.into()

View file

@ -178,7 +178,7 @@ impl SongEditor {
.map(|_| Message::None),
)
.height(250)
.center_x(Length::Shrink)
.center_x(Length::Fill)
.padding([0, 20])
.clip(true)
.into()