Fixed the FUCKING bug
y'know the one where the progress bar disappeared at many resolutions
This commit is contained in:
parent
807289ca46
commit
b715155b20
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue