@@ -281,6 +281,7 @@ class SimpleMenuItem {
281281 this . label . clutter_text . ellipsize = Pango . EllipsizeMode . END ;
282282 this . actor . add_actor ( this . labelContainer ) ;
283283 this . labelContainer . add_actor ( this . label ) ;
284+ this . actor . set_label_actor ( this . label ) ;
284285 }
285286
286287 addDescription ( label = '' , styleClass = null ) {
@@ -302,6 +303,20 @@ class SimpleMenuItem {
302303 this . labelContainer . add_actor ( this . descriptionLabel ) ;
303304 }
304305
306+ updateAccessibleName ( ) {
307+ this . actor . set_label_actor ( null ) ;
308+
309+ let name = "" ;
310+ if ( this . label )
311+ name += this . label . get_text ( ) ;
312+ if ( this . descriptionLabel ) {
313+ if ( name . length > 0 )
314+ name += ". " ;
315+ name += this . descriptionLabel . get_text ( ) ;
316+ }
317+ this . actor . set_accessible_name ( name ) ;
318+ }
319+
305320 /**
306321 * Adds a ClutterActor as the next child.
307322 *
@@ -333,7 +348,7 @@ class SimpleMenuItem {
333348
334349class ApplicationContextMenuItem extends PopupMenu . PopupBaseMenuItem {
335350 constructor ( appButton , label , action , iconName ) {
336- super ( { focusOnHover : false } ) ;
351+ super ( { focusOnHover : true } ) ;
337352
338353 this . _appButton = appButton ;
339354 this . _action = action ;
@@ -350,6 +365,7 @@ class ApplicationContextMenuItem extends PopupMenu.PopupBaseMenuItem {
350365 }
351366
352367 this . addActor ( this . label ) ;
368+ this . actor . set_label_actor ( this . label ) ;
353369 }
354370
355371 activate ( event ) {
@@ -604,6 +620,8 @@ class ApplicationButton extends GenericApplicationButton {
604620 if ( applet . showDescription )
605621 this . addDescription ( this . description , 'appmenu-application-button-description' ) ;
606622
623+ this . updateAccessibleName ( ) ;
624+
607625 this . _draggable = DND . makeDraggable ( this . actor ) ;
608626 this . _signals . connect ( this . _draggable , 'drag-end' , this . _onDragEnd . bind ( this ) ) ;
609627 this . isDraggableApp = true ;
@@ -809,7 +827,6 @@ class CategoryButton extends SimpleMenuItem {
809827 styleClass : 'appmenu-category-button' ,
810828 categoryId : categoryId ,
811829 } ) ;
812- this . actor . accessible_role = Atk . Role . LIST_ITEM ;
813830
814831 let size = applet . categoryIconSize ;
815832 if ( applet . symbolicCategoryIcons ) {
@@ -895,6 +912,8 @@ class SystemButton extends SimpleMenuItem {
895912 styleClass : 'appmenu-system-button' ,
896913 } ) ;
897914 this . addIcon ( 16 , iconName , null , true ) ;
915+ this . actor . set_accessible_name ( name ) ;
916+ this . actor . set_accessible_role ( Atk . Role . BUTTON ) ;
898917 }
899918}
900919
@@ -1818,6 +1837,7 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
18181837
18191838 _buttonEnterEvent ( button ) {
18201839 this . categoriesBox . get_children ( ) . forEach ( child => child . remove_style_pseudo_class ( "hover" ) ) ;
1840+ this . categoriesBox . get_children ( ) . forEach ( child => child . remove_accessible_state ( Atk . StateType . FOCUSED ) ) ;
18211841 this . applicationsBox . get_children ( ) . forEach ( child => child . set_style_class_name ( "appmenu-application-button" ) ) ;
18221842 this . favoriteAppsBox . get_children ( ) . forEach ( child => child . remove_style_pseudo_class ( "hover" ) ) ;
18231843 this . placesBox . get_children ( ) . forEach ( child => child . remove_style_pseudo_class ( "hover" ) ) ;
@@ -1847,6 +1867,7 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
18471867 }
18481868 }
18491869
1870+ button . actor . add_accessible_state ( Atk . StateType . FOCUSED ) ;
18501871
18511872 let parent = button . actor . get_parent ( ) ;
18521873 this . _activeContainer = parent ;
@@ -1868,6 +1889,8 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
18681889 button . actor . set_style_class_name ( button . styleClass ) ;
18691890 }
18701891
1892+ button . actor . remove_accessible_state ( Atk . StateType . FOCUSED ) ;
1893+
18711894 // This method is only called on mouse leave so return key focus to the
18721895 // currently active category button.
18731896 this . _setKeyFocusToCurrentCategoryButton ( ) ;
@@ -2451,6 +2474,9 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
24512474 let user = AccountsService . UserManager . get_default ( ) . get_user ( GLib . get_user_name ( ) ) ;
24522475 this . userIcon = new UserWidget . UserWidget ( user , Clutter . Orientation . VERTICAL , false ) ;
24532476 this . userIcon . set_reactive ( true ) ;
2477+ this . userIcon . track_hover = true ;
2478+ this . userIcon . set_accessible_role ( Atk . Role . BUTTON ) ;
2479+ this . userIcon . set_accessible_name ( _ ( "Account details" ) ) ;
24542480 this . userIcon . connect ( 'button-press-event' , ( ) => {
24552481 this . menu . toggle ( ) ;
24562482 Util . spawnCommandLine ( "cinnamon-settings user" ) ;
@@ -2525,7 +2551,10 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
25252551 name : 'appmenu-search-entry' ,
25262552 track_hover : true ,
25272553 can_focus : true ,
2554+ accessible_name : _ ( "Search" ) ,
2555+ accessible_role : Atk . Role . ENTRY ,
25282556 } ) ;
2557+ this . searchEntry . add_accessible_state ( Atk . StateType . EDITABLE ) ;
25292558
25302559 this . searchEntry . set_secondary_icon ( this . _searchInactiveIcon ) ;
25312560 this . searchActive = false ;
0 commit comments