Compare commits
2 Commits
b9883d2ad1
...
b715155b20
Author | SHA1 | Date |
---|---|---|
Emi Simpson | b715155b20 | |
Emi Simpson | 807289ca46 |
|
@ -2,6 +2,7 @@ use iced::Command;
|
||||||
use core::time::Duration;
|
use core::time::Duration;
|
||||||
use iced::Length;
|
use iced::Length;
|
||||||
use iced::Color;
|
use iced::Color;
|
||||||
|
use iced::Point;
|
||||||
use symphonia::core::formats::FormatReader;
|
use symphonia::core::formats::FormatReader;
|
||||||
use crate::player::PlayerError;
|
use crate::player::PlayerError;
|
||||||
use iced::canvas::event::Status;
|
use iced::canvas::event::Status;
|
||||||
|
@ -111,23 +112,23 @@ impl Program<Message> for (&Controls, Theme) {
|
||||||
let mut background = self.1.text_color;
|
let mut background = self.1.text_color;
|
||||||
background.a = 0.2;
|
background.a = 0.2;
|
||||||
|
|
||||||
frame.fill_rectangle(bounds.position(), bounds.size(), background);
|
frame.fill_rectangle(Point::ORIGIN, bounds.size(), background);
|
||||||
|
|
||||||
let mut played_size = bounds.size();
|
let mut played_size = bounds.size();
|
||||||
played_size.height *= player.position_percent();
|
played_size.height *= player.position_percent();
|
||||||
|
|
||||||
frame.fill_rectangle(bounds.position(), played_size, self.1.text_color);
|
frame.fill_rectangle(Point::ORIGIN, played_size, self.1.text_color);
|
||||||
},
|
},
|
||||||
NoError { player: _, has_device: false } => {
|
NoError { player: _, has_device: false } => {
|
||||||
let mut background = self.1.text_color;
|
let mut background = self.1.text_color;
|
||||||
background.a = 0.1;
|
background.a = 0.1;
|
||||||
|
|
||||||
frame.fill_rectangle(bounds.position(), bounds.size(), background);
|
frame.fill_rectangle(Point::ORIGIN, bounds.size(), background);
|
||||||
},
|
},
|
||||||
Error(e) => {
|
Error(e) => {
|
||||||
let background = Color {r: 1., g: 0.1, b: 0.1, a: 1.};
|
let background = Color {r: 1., g: 0.1, b: 0.1, a: 1.};
|
||||||
|
|
||||||
frame.fill_rectangle(bounds.position(), bounds.size(), background);
|
frame.fill_rectangle(Point::ORIGIN, bounds.size(), background);
|
||||||
eprintln!("Error!!! {}", e.to_string());
|
eprintln!("Error!!! {}", e.to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,9 +40,11 @@ impl Editor {
|
||||||
}).unwrap_or_else(|| Theme::default());
|
}).unwrap_or_else(|| Theme::default());
|
||||||
|
|
||||||
let cover = cover.expect("TODO");
|
let cover = cover.expect("TODO");
|
||||||
let bg_img = DynamicImage::ImageBgra8(
|
|
||||||
cover.blur((cover.width() / 50) as f32).into_bgra8()
|
#[cfg(not(debug_assertions))]
|
||||||
);
|
let cover = cover.blur((cover.width() / 50) as f32);
|
||||||
|
|
||||||
|
let bg_img = DynamicImage::ImageBgra8(cover.into_bgra8());
|
||||||
|
|
||||||
let (controls, cmd) = Controls::new(song);
|
let (controls, cmd) = Controls::new(song);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue