@@ -131,6 +131,12 @@ void QgsAppLayoutDesignerInterface::close()
131
131
}
132
132
133
133
134
+ static bool cmpByText_ ( QAction *a, QAction *b )
135
+ {
136
+ return QString::localeAwareCompare ( a->text (), b->text () ) < 0 ;
137
+ }
138
+
139
+
134
140
QgsLayoutDesignerDialog::QgsLayoutDesignerDialog ( QWidget *parent, Qt::WindowFlags flags )
135
141
: QMainWindow( parent, flags )
136
142
, mInterface( new QgsAppLayoutDesignerInterface( this ) )
@@ -729,6 +735,14 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
729
735
mLayoutsMenu ->setObjectName ( QStringLiteral ( " mLayoutsMenu" ) );
730
736
connect ( mLayoutsMenu , &QMenu::aboutToShow, this , &QgsLayoutDesignerDialog::populateLayoutsMenu );
731
737
738
+ QList<QAction *> actions = mPanelsMenu ->actions ();
739
+ std::sort ( actions.begin (), actions.end (), cmpByText_ );
740
+ mPanelsMenu ->insertActions ( nullptr , actions );
741
+
742
+ actions = mToolbarMenu ->actions ();
743
+ std::sort ( actions.begin (), actions.end (), cmpByText_ );
744
+ mToolbarMenu ->insertActions ( nullptr , actions );
745
+
732
746
restoreWindowState ();
733
747
734
748
// listen out to status bar updates from the view
@@ -740,11 +754,6 @@ QgsAppLayoutDesignerInterface *QgsLayoutDesignerDialog::iface()
740
754
return mInterface ;
741
755
}
742
756
743
- static bool cmpByText_ ( QAction *a, QAction *b )
744
- {
745
- return QString::localeAwareCompare ( a->text (), b->text () ) < 0 ;
746
- }
747
-
748
757
QMenu *QgsLayoutDesignerDialog::createPopupMenu ()
749
758
{
750
759
QMenu *menu = QMainWindow::createPopupMenu ();
0 commit comments