Skip to content

Commit

Permalink
Add placeholder for empty images in episode posters (#67)
Browse files Browse the repository at this point in the history
* Add grayscaled program logo as a placeholder for empty images

* Put placeholder on empty image episode poster

* Code refactor
  • Loading branch information
MaarifaMaarifa authored Oct 23, 2023
1 parent 2de37ed commit cb516c9
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/gui/troxide_widget.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
pub mod episode_widget {
pub use crate::gui::message::IndexedMessage;
use crate::{
core::{api::tv_maze::episodes_information::Episode as EpisodeInfo, caching, database},
gui::{assets::icons::EYE_FILL, helpers::season_episode_str_gen, styles},
use crate::core::{
api::tv_maze::episodes_information::Episode as EpisodeInfo, caching, database,
};
use crate::gui::assets::icons::EYE_FILL;
use crate::gui::helpers::{self, season_episode_str_gen};
pub use crate::gui::message::IndexedMessage;
use crate::gui::styles;
use bytes::Bytes;
use iced::{
font::Weight,
widget::{
button, checkbox, column, container, horizontal_space, image, row, svg, text,
vertical_space, Row, Space, Text,
},
Command, Element, Font, Length, Renderer,
use iced::font::Weight;
use iced::widget::{
button, checkbox, column, container, horizontal_space, image, row, svg, text,
vertical_space, Row, Space, Text,
};
use iced::{Command, Element, Font, Length, Renderer};

#[derive(Clone, Debug)]
pub enum Message {
Expand Down Expand Up @@ -143,7 +143,11 @@ pub mod episode_widget {
let image = image(image_handle).height(image_height);
content = content.push(image);
} else {
content = content.push(Space::new(image_width, image_height));
content = content.push(
helpers::empty_image::empty_image()
.width(image_width)
.height(image_height),
);
};

let episode_details = column!(
Expand Down

0 comments on commit cb516c9

Please sign in to comment.