Give media grids a more consistent layout
Centering everything caused the posters to vary in position depending on the number of title lines and the presence of an original title. Now we simply fill each item top to bottom and reserve space for the poster even if there is none - we're aiming to have a poster for every piece of media anyway.
This commit is contained in:
parent
23e8f1e949
commit
18d6eedb15
3 changed files with 4 additions and 6 deletions
|
|
@ -22,6 +22,10 @@ impl FileSystemManager {
|
|||
}
|
||||
|
||||
pub async fn poster(&self, uuid: &str) -> Result<Option<Texture>, DataManagerError> {
|
||||
// TODO: Investigate if we can limit the size of the poster here already, so
|
||||
// that we could use a gtk4::Picture in the UI and avoid wasting space due
|
||||
// to the square aspect ratio limitation of gtk4::Image.
|
||||
|
||||
let file_path = concat_os_str!(&self.data_dir, "/posters/", uuid);
|
||||
let texture = spawn_blocking(move || Texture::from_filename(file_path))
|
||||
.await
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ impl FactoryComponent for FilmGridItem {
|
|||
|
||||
gtk4::Box {
|
||||
set_orientation: Orientation::Vertical,
|
||||
set_valign: Align::Center,
|
||||
set_margin_vertical: 20,
|
||||
|
||||
#[name="poster"]
|
||||
|
|
@ -73,8 +72,6 @@ impl FactoryComponent for FilmGridItem {
|
|||
set_margin_bottom: 20,
|
||||
#[watch]
|
||||
set_paintable: self.poster.as_ref(),
|
||||
#[watch]
|
||||
set_visible: self.poster.is_some(),
|
||||
},
|
||||
|
||||
#[name="name"]
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ impl FactoryComponent for SeriesGridItem {
|
|||
set_css_classes: &["flat", "media-grid-item"],
|
||||
gtk4::Box {
|
||||
set_orientation: Orientation::Vertical,
|
||||
set_valign: Align::Center,
|
||||
set_margin_vertical: 20,
|
||||
|
||||
#[name="poster"]
|
||||
|
|
@ -66,8 +65,6 @@ impl FactoryComponent for SeriesGridItem {
|
|||
set_margin_bottom: 20,
|
||||
#[watch]
|
||||
set_paintable: self.poster.as_ref(),
|
||||
#[watch]
|
||||
set_visible: self.poster.is_some(),
|
||||
},
|
||||
|
||||
#[name="name"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue