Fix gallery image alignment
This commit is contained in:
parent
f62bfce780
commit
6fa9784109
1 changed files with 18 additions and 10 deletions
28
src/tab.rs
28
src/tab.rs
|
|
@ -3016,19 +3016,27 @@ impl Tab {
|
||||||
ItemThumbnail::Image(handle, _) => {
|
ItemThumbnail::Image(handle, _) => {
|
||||||
if let Some(path) = item.path_opt() {
|
if let Some(path) = item.path_opt() {
|
||||||
element_opt = Some(
|
element_opt = Some(
|
||||||
//TODO: use widget::image::viewer, when its zoom can be reset
|
widget::container(
|
||||||
widget::image(widget::image::Handle::from_path(path))
|
//TODO: use widget::image::viewer, when its zoom can be reset
|
||||||
.width(Length::Fill)
|
widget::image(widget::image::Handle::from_path(path)),
|
||||||
.height(Length::Fill)
|
)
|
||||||
.into(),
|
.align_x(Alignment::Center)
|
||||||
|
.align_y(Alignment::Center)
|
||||||
|
.width(Length::Fill)
|
||||||
|
.height(Length::Fill)
|
||||||
|
.into(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
element_opt = Some(
|
element_opt = Some(
|
||||||
//TODO: use widget::image::viewer, when its zoom can be reset
|
widget::container(
|
||||||
widget::image(handle.clone())
|
//TODO: use widget::image::viewer, when its zoom can be reset
|
||||||
.width(Length::Fill)
|
widget::image(handle.clone()),
|
||||||
.height(Length::Fill)
|
)
|
||||||
.into(),
|
.align_x(Alignment::Center)
|
||||||
|
.align_y(Alignment::Center)
|
||||||
|
.width(Length::Fill)
|
||||||
|
.height(Length::Fill)
|
||||||
|
.into(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue