Skip to content

Commit

Permalink
Use QgsMenuHeaderWidgetAction instead of QMenu::addSection
Browse files Browse the repository at this point in the history
Because addSection adds really ugly separators and throws out
the menu alignment
  • Loading branch information
nyalldawson committed Jul 25, 2017
1 parent 778e84b commit 53c6308
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -204,6 +204,7 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include "qgsmapoverviewcanvas.h"
#include "qgsmapsettings.h"
#include "qgsmaptip.h"
#include "qgsmenuheader.h"
#include "qgsmergeattributesdialog.h"
#include "qgsmessageviewer.h"
#include "qgsmessagebar.h"
Expand Down Expand Up @@ -2304,11 +2305,13 @@ void QgisApp::refreshProfileMenu()
QString activeName = profile->name();
mConfigMenu->setTitle( tr( "&User Profiles" ) );

mConfigMenu->addSection( tr( "Active Profile" ) );
mConfigMenu->addAction( new QgsMenuHeaderWidgetAction( tr( "Active Profile" ), mConfigMenu ) );

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

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

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

0 comments on commit 53c6308

Please sign in to comment.