layout of main window is getting closer
This commit is contained in:
parent
102cba5dd5
commit
9031d15678
69
src/main.rs
69
src/main.rs
|
@ -446,43 +446,46 @@ impl cosmic::Application for App {
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
|
|
||||||
let slide_preview = Container::new(
|
let slide_preview = column![
|
||||||
column![
|
Space::with_height(Length::Fill),
|
||||||
Responsive::new(|size| {
|
Responsive::new(|size| {
|
||||||
debug!(?size);
|
debug!(?size);
|
||||||
let height = size.width * 9.0 / 16.0;
|
let height = size.width * 9.0 / 16.0;
|
||||||
debug!(?height);
|
debug!(?height);
|
||||||
|
Container::new(
|
||||||
Container::new(
|
Container::new(
|
||||||
self.presenter
|
self.presenter
|
||||||
.view()
|
.view()
|
||||||
.map(|m| Message::Present(m)),
|
.map(|m| Message::Present(m)),
|
||||||
)
|
)
|
||||||
.height(height)
|
.height(height),
|
||||||
.max_height(height)
|
|
||||||
.into()
|
|
||||||
}),
|
|
||||||
Container::new(
|
|
||||||
row![
|
|
||||||
video_button_icon,
|
|
||||||
Container::new(slider(
|
|
||||||
0.0..=video_range,
|
|
||||||
video_pos,
|
|
||||||
|pos| {
|
|
||||||
Message::Present(
|
|
||||||
presenter::Message::VideoPos(pos),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
))
|
|
||||||
.center_x(Length::Fill)
|
|
||||||
.padding([7, 0, 0, 0])
|
|
||||||
]
|
|
||||||
.padding(5)
|
|
||||||
)
|
)
|
||||||
.center_x(Length::Fill),
|
.align_bottom(Length::Fill)
|
||||||
]
|
.into()
|
||||||
.spacing(3),
|
}),
|
||||||
)
|
Container::new(if self.presenter.video.is_some() {
|
||||||
.center_y(Length::Shrink);
|
row![
|
||||||
|
video_button_icon,
|
||||||
|
Container::new(slider(
|
||||||
|
0.0..=video_range,
|
||||||
|
video_pos,
|
||||||
|
|pos| {
|
||||||
|
Message::Present(
|
||||||
|
presenter::Message::VideoPos(pos),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
))
|
||||||
|
.center_x(Length::Fill)
|
||||||
|
.padding([7, 0, 0, 0])
|
||||||
|
]
|
||||||
|
.padding(5)
|
||||||
|
} else {
|
||||||
|
row![]
|
||||||
|
})
|
||||||
|
.center_x(Length::Fill),
|
||||||
|
Space::with_height(Length::Fill),
|
||||||
|
]
|
||||||
|
.spacing(3);
|
||||||
|
|
||||||
let row = row![
|
let row = row![
|
||||||
Container::new(
|
Container::new(
|
||||||
|
@ -496,7 +499,7 @@ impl cosmic::Application for App {
|
||||||
)
|
)
|
||||||
.center_y(Length::Fill)
|
.center_y(Length::Fill)
|
||||||
.align_right(Length::Fill)
|
.align_right(Length::Fill)
|
||||||
.width(Length::FillPortion(1)),
|
.width(Length::FillPortion(2)),
|
||||||
Container::new(slide_preview)
|
Container::new(slide_preview)
|
||||||
.center_y(Length::Fill)
|
.center_y(Length::Fill)
|
||||||
.width(Length::FillPortion(3)),
|
.width(Length::FillPortion(3)),
|
||||||
|
@ -511,7 +514,7 @@ impl cosmic::Application for App {
|
||||||
)
|
)
|
||||||
.center_y(Length::Fill)
|
.center_y(Length::Fill)
|
||||||
.align_left(Length::Fill)
|
.align_left(Length::Fill)
|
||||||
.width(Length::FillPortion(1)),
|
.width(Length::FillPortion(2)),
|
||||||
]
|
]
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.height(Length::Fill)
|
.height(Length::Fill)
|
||||||
|
|
Loading…
Reference in a new issue