File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1243,6 +1243,7 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
12431243 constructor ( orientation , panel_height , instance_id ) {
12441244 super ( orientation , panel_height , instance_id ) ;
12451245
1246+ this . orientation = orientation ;
12461247 this . setAllowedLayout ( Applet . AllowedLayout . BOTH ) ;
12471248
12481249 this . set_applet_tooltip ( _ ( "Menu" ) ) ;
@@ -1551,6 +1552,14 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
15511552 }
15521553 this . _allAppsCategoryButton . actor . style_class = "appmenu-category-button-selected" ;
15531554
1555+ // Center menu if applet in center zone of top or bottom panel.
1556+ const appletDefinition = Main . AppletManager . getAppletDefinition ( { applet_id : this . instance_id } ) ;
1557+ if ( ( this . orientation === St . Side . BOTTOM || this . orientation === St . Side . TOP ) &&
1558+ appletDefinition . location_label === 'center' ) {
1559+ const monitor = Main . layoutManager . findMonitorForActor ( this . menu . actor ) ;
1560+ this . menu . shiftToPosition ( Math . floor ( monitor . width / 2 ) + monitor . x ) ;
1561+ }
1562+
15541563 Mainloop . idle_add ( ( ) => {
15551564 if ( this . lastSelectedCategory !== null ) //if a category is already selected
15561565 return ;
You can’t perform that action at this time.
0 commit comments