Ensure that previews keep aspect ratio
This commit is contained in:
parent
752e29e281
commit
143aa6d32b
1 changed files with 5 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ use cosmic::{
|
||||||
//TODO: export in cosmic::widget
|
//TODO: export in cosmic::widget
|
||||||
widget::horizontal_rule,
|
widget::horizontal_rule,
|
||||||
Alignment,
|
Alignment,
|
||||||
|
ContentFit,
|
||||||
Length,
|
Length,
|
||||||
Point,
|
Point,
|
||||||
},
|
},
|
||||||
|
|
@ -466,6 +467,7 @@ impl Item {
|
||||||
.into()
|
.into()
|
||||||
} else {
|
} else {
|
||||||
widget::icon::icon(self.icon_handle_grid.clone())
|
widget::icon::icon(self.icon_handle_grid.clone())
|
||||||
|
.content_fit(ContentFit::Contain)
|
||||||
.size(sizes.grid())
|
.size(sizes.grid())
|
||||||
.into()
|
.into()
|
||||||
},
|
},
|
||||||
|
|
@ -933,6 +935,7 @@ impl Tab {
|
||||||
let button = widget::button(
|
let button = widget::button(
|
||||||
widget::column::with_children(vec![
|
widget::column::with_children(vec![
|
||||||
widget::icon::icon(item.icon_handle_grid.clone())
|
widget::icon::icon(item.icon_handle_grid.clone())
|
||||||
|
.content_fit(ContentFit::Contain)
|
||||||
.size(icon_sizes.grid())
|
.size(icon_sizes.grid())
|
||||||
.into(),
|
.into(),
|
||||||
widget::text(item.name.clone()).into(),
|
widget::text(item.name.clone()).into(),
|
||||||
|
|
@ -1050,10 +1053,12 @@ impl Tab {
|
||||||
widget::row::with_children(vec![
|
widget::row::with_children(vec![
|
||||||
if self.dialog.is_some() {
|
if self.dialog.is_some() {
|
||||||
widget::icon::icon(item.icon_handle_dialog.clone())
|
widget::icon::icon(item.icon_handle_dialog.clone())
|
||||||
|
.content_fit(ContentFit::Contain)
|
||||||
.size(icon_sizes.dialog())
|
.size(icon_sizes.dialog())
|
||||||
.into()
|
.into()
|
||||||
} else {
|
} else {
|
||||||
widget::icon::icon(item.icon_handle_list.clone())
|
widget::icon::icon(item.icon_handle_list.clone())
|
||||||
|
.content_fit(ContentFit::Contain)
|
||||||
.size(icon_sizes.list())
|
.size(icon_sizes.list())
|
||||||
.into()
|
.into()
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue