EpisodeWidget: change DownloadPlayMachine default constructor to a hidden state.

This commit is contained in:
Jordan Petridis 2018-02-10 08:13:07 +02:00
parent 46bd23cf66
commit f7b5b35374
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -344,15 +344,15 @@ pub struct DownloadPlay<S> {
state: S, state: S,
} }
impl DownloadPlay<Download> { impl DownloadPlay<Hidden> {
fn new(play: gtk::Button, download: gtk::Button) -> Self { fn new(play: gtk::Button, download: gtk::Button) -> Self {
play.hide(); play.hide();
download.show(); download.hide();
DownloadPlay { DownloadPlay {
play, play,
download, download,
state: Download {}, state: Hidden {},
} }
} }
} }
@ -443,7 +443,7 @@ pub enum DownloadPlayMachine {
impl DownloadPlayMachine { impl DownloadPlayMachine {
pub fn new(play: gtk::Button, download: gtk::Button) -> Self { pub fn new(play: gtk::Button, download: gtk::Button) -> Self {
DownloadPlayMachine::Download(DownloadPlay::<Download>::new(play, download)) DownloadPlayMachine::Hidden(DownloadPlay::<Hidden>::new(play, download))
} }
pub fn determine_state(self, downloaded: bool, should_hide: bool) -> Self { pub fn determine_state(self, downloaded: bool, should_hide: bool) -> Self {