Use bg_component_color as background for audio
This commit is contained in:
parent
67caa89151
commit
d65acd4979
1 changed files with 7 additions and 3 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -1221,13 +1221,14 @@ impl Application for App {
|
|||
|
||||
/// Creates a view after each update.
|
||||
fn view(&self) -> Element<Self::Message> {
|
||||
let theme = theme::active();
|
||||
let cosmic_theme::Spacing {
|
||||
space_xxs,
|
||||
space_xs,
|
||||
space_s,
|
||||
space_m,
|
||||
..
|
||||
} = theme::active().cosmic().spacing;
|
||||
} = theme.cosmic().spacing;
|
||||
|
||||
let format_time = |time_float: f64| -> String {
|
||||
let time = time_float.floor() as i64;
|
||||
|
|
@ -1274,8 +1275,11 @@ impl Application for App {
|
|||
.height(Length::Fill)
|
||||
.into();
|
||||
|
||||
let mut background_color = Color::BLACK;
|
||||
if let Some(album_art) = &self.album_art_opt {
|
||||
if !video.has_video() {
|
||||
background_color = theme.cosmic().bg_component_color().into();
|
||||
|
||||
let mut col = widget::column();
|
||||
col = col.push(widget::vertical_space(Length::Fill));
|
||||
col = col.push(
|
||||
|
|
@ -1517,8 +1521,8 @@ impl Application for App {
|
|||
widget::container(popover)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.style(theme::Container::Custom(Box::new(|_theme| {
|
||||
widget::container::Appearance::default().with_background(Color::BLACK)
|
||||
.style(theme::Container::Custom(Box::new(move |_theme| {
|
||||
widget::container::Appearance::default().with_background(background_color)
|
||||
})))
|
||||
.into()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue