File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -603,6 +603,17 @@ impl cosmic::Application for Audio {
603
603
tracing:: error!( "Error playing previous: {}" , err) ;
604
604
}
605
605
} ) ,
606
+ MprisRequest :: Raise => tokio:: spawn ( async move {
607
+ let res = player. media_player ( ) . await ;
608
+ if let Err ( err) = res {
609
+ tracing:: error!( "Error fetching MediaPlayer: {}" , err) ;
610
+ } else {
611
+ let res = res. unwrap ( ) . raise ( ) . await ;
612
+ if let Err ( err) = res {
613
+ tracing:: error!( "Error raising client: {}" , err) ;
614
+ }
615
+ }
616
+ } ) ,
606
617
} ;
607
618
}
608
619
Message :: OpenSettings => {
@@ -945,10 +956,13 @@ impl cosmic::Application for Audio {
945
956
audio_content = audio_content
946
957
. push ( padded_control ( divider:: horizontal:: default ( ) ) . padding ( [ space_xxs, space_s] ) ) ;
947
958
audio_content = audio_content. push (
948
- Row :: with_children ( elements)
949
- . align_y ( Alignment :: Center )
950
- . spacing ( 8 )
951
- . padding ( menu_control_padding ( ) ) ,
959
+ menu_button (
960
+ Row :: with_children ( elements)
961
+ . align_y ( Alignment :: Center )
962
+ . spacing ( 8 ) ,
963
+ )
964
+ . on_press ( Message :: MprisRequest ( MprisRequest :: Raise ) )
965
+ . padding ( menu_control_padding ( ) ) ,
952
966
) ;
953
967
}
954
968
let content = column ! [
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ pub enum MprisRequest {
126
126
Pause ,
127
127
Next ,
128
128
Previous ,
129
+ Raise ,
129
130
}
130
131
131
132
struct State {
@@ -282,7 +283,7 @@ async fn run(output: &mut futures::channel::mpsc::Sender<MprisUpdate>) {
282
283
_ = state. any_player_state_stream. next( ) , if !state. players. is_empty( ) => {
283
284
state. update_active_player( ) . await ;
284
285
} ,
285
- } ;
286
+ }
286
287
}
287
288
}
288
289
You can’t perform that action at this time.
0 commit comments