@@ -381,10 +381,19 @@ impl NotifyWindow {
381381 fn selected_subscription_changed ( & self , sub : Option < & Subscription > ) {
382382 let imp = self . imp ( ) ;
383383 self . update_banner ( sub) ;
384+ let this = self . clone ( ) ;
385+ let set_sensitive = move |b| {
386+ let imp = this. imp ( ) ;
387+ imp. subscription_menu_btn . set_sensitive ( b) ;
388+ imp. code_btn . set_sensitive ( b) ;
389+ imp. send_btn . set_sensitive ( b) ;
390+ imp. entry . set_sensitive ( b) ;
391+ } ;
384392 if let Some ( ( sub, id) ) = imp. banner_binding . take ( ) {
385393 sub. disconnect ( id) ;
386394 }
387395 if let Some ( sub) = sub {
396+ set_sensitive ( true ) ;
388397 imp. navigation_split_view . set_show_content ( true ) ;
389398 imp. message_list
390399 . bind_model ( Some ( & sub. imp ( ) . messages ) , move |obj| {
@@ -393,10 +402,6 @@ impl NotifyWindow {
393402
394403 MessageRow :: new ( msg. clone ( ) ) . upcast ( )
395404 } ) ;
396- imp. subscription_menu_btn . set_sensitive ( true ) ;
397- imp. send_btn . set_sensitive ( true ) ;
398- imp. code_btn . set_sensitive ( true ) ;
399- imp. entry . set_sensitive ( true ) ;
400405
401406 let this = self . clone ( ) ;
402407 imp. banner_binding . set ( Some ( (
@@ -411,12 +416,9 @@ impl NotifyWindow {
411416 this. flag_read ( ) ;
412417 } ) ;
413418 } else {
419+ set_sensitive ( false ) ;
414420 imp. message_list
415421 . bind_model ( gio:: ListModel :: NONE , |_| adw:: Bin :: new ( ) . into ( ) ) ;
416- imp. subscription_menu_btn . set_sensitive ( false ) ;
417- imp. code_btn . set_sensitive ( false ) ;
418- imp. send_btn . set_sensitive ( false ) ;
419- imp. entry . set_sensitive ( false ) ;
420422 }
421423 }
422424 fn flag_read ( & self ) {
0 commit comments