Mpris: Implement the raise method
This commit is contained in:
parent
6a52a2bc46
commit
e0b3dd9795
BIN
podcasts-gtk/resources/resources.gresource.LEWQQZ
Normal file
BIN
podcasts-gtk/resources/resources.gresource.LEWQQZ
Normal file
Binary file not shown.
@ -65,6 +65,7 @@ pub(crate) enum Action {
|
|||||||
InitShowMenu(Fragile<ShowMenu>),
|
InitShowMenu(Fragile<ShowMenu>),
|
||||||
EmptyState,
|
EmptyState,
|
||||||
PopulatedState,
|
PopulatedState,
|
||||||
|
RaiseWindow,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@ -370,6 +371,7 @@ impl App {
|
|||||||
self.headerbar.switch.set_sensitive(true);
|
self.headerbar.switch.set_sensitive(true);
|
||||||
self.content.switch_to_populated();
|
self.content.switch_to_populated();
|
||||||
}
|
}
|
||||||
|
Action::RaiseWindow => self.window.present(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -293,7 +293,7 @@ impl PlayerWidget {
|
|||||||
fn init(s: &Rc<Self>, sender: &Sender<Action>) {
|
fn init(s: &Rc<Self>, sender: &Sender<Action>) {
|
||||||
Self::connect_control_buttons(s);
|
Self::connect_control_buttons(s);
|
||||||
Self::connect_rate_buttons(s);
|
Self::connect_rate_buttons(s);
|
||||||
Self::connect_mpris_buttons(s);
|
Self::connect_mpris_buttons(s, sender);
|
||||||
Self::connect_gst_signals(s, sender);
|
Self::connect_gst_signals(s, sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ impl PlayerWidget {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn connect_mpris_buttons(s: &Rc<Self>) {
|
fn connect_mpris_buttons(s: &Rc<Self>, sender: &Sender<Action>) {
|
||||||
let weak = Rc::downgrade(s);
|
let weak = Rc::downgrade(s);
|
||||||
|
|
||||||
let mpris = s.info.mpris.clone();
|
let mpris = s.info.mpris.clone();
|
||||||
@ -349,9 +349,7 @@ impl PlayerWidget {
|
|||||||
weak.upgrade().map(|p| p.rewind());
|
weak.upgrade().map(|p| p.rewind());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
//s.info.mpris.connect_raise(clone!(weak => move || {
|
s.info.mpris.connect_raise(clone!(sender => move || sender.send(Action::RaiseWindow)));
|
||||||
// TODO: Do something here
|
|
||||||
//}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user