Skip to content

Commit 53c6308

Browse files
committed
Use QgsMenuHeaderWidgetAction instead of QMenu::addSection
Because addSection adds really ugly separators and throws out the menu alignment
1 parent 778e84b commit 53c6308

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/app/qgisapp.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
204204
#include "qgsmapoverviewcanvas.h"
205205
#include "qgsmapsettings.h"
206206
#include "qgsmaptip.h"
207+
#include "qgsmenuheader.h"
207208
#include "qgsmergeattributesdialog.h"
208209
#include "qgsmessageviewer.h"
209210
#include "qgsmessagebar.h"
@@ -2304,11 +2305,13 @@ void QgisApp::refreshProfileMenu()
23042305
QString activeName = profile->name();
23052306
mConfigMenu->setTitle( tr( "&User Profiles" ) );
23062307

2307-
mConfigMenu->addSection( tr( "Active Profile" ) );
2308+
mConfigMenu->addAction( new QgsMenuHeaderWidgetAction( tr( "Active Profile" ), mConfigMenu ) );
23082309

2309-
QAction *profileSection = mConfigMenu->addSection( tr( "Profiles" ) );
2310+
mConfigMenu->addAction( new QgsMenuHeaderWidgetAction( tr( "Profiles" ), mConfigMenu ) );
2311+
QAction *profileSection = mConfigMenu->actions().at( 1 );
23102312

2311-
QAction *configSection = mConfigMenu->addSection( tr( "Config" ) );
2313+
mConfigMenu->addAction( new QgsMenuHeaderWidgetAction( tr( "Config" ), mConfigMenu ) );
2314+
QAction *configSection = mConfigMenu->actions().at( 2 );
23122315

23132316
QAction *openProfileFolderAction = mConfigMenu->addAction( tr( "Open current profile folder" ) );
23142317
connect( openProfileFolderAction, &QAction::triggered, this, [this]()

0 commit comments

Comments
 (0)