@@ -477,22 +477,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
477477 // set the focus to the map canvas
478478 mMapCanvas ->setFocus ();
479479
480- // a bar to warn the user with non-blocking messages
481- mInfoBar = new QgsMessageBar ( centralWidget );
482- mInfoBar ->setSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Fixed );
483- centralLayout->addWidget ( mInfoBar , 0 , 0 , 1 , 1 );
484-
485- mMacrosWarn = QgsMessageBar::createMessage ( tr ( " Security warning:" ),
486- tr ( " macros have been disabled." ),
487- QgsApplication::getThemeIcon ( " /mIconWarn.png" ),
488- mInfoBar );
489-
490- QToolButton *btnEnableMacros = new QToolButton ( mMacrosWarn );
491- btnEnableMacros->setText ( tr ( " Enable" ) );
492- connect ( btnEnableMacros, SIGNAL ( clicked () ), mInfoBar , SLOT ( popWidget () ) );
493- connect ( btnEnableMacros, SIGNAL ( clicked () ), this , SLOT ( enableProjectMacros () ) );
494- mMacrosWarn ->layout ()->addWidget ( btnEnableMacros );
495-
496480 // "theMapLegend" used to find this canonical instance later
497481 mMapLegend = new QgsLegend ( mMapCanvas , this , " theMapLegend" );
498482
@@ -518,6 +502,24 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
518502 updateProjectFromTemplates ();
519503 activateDeactivateLayerRelatedActions ( NULL );
520504
505+ // a bar to warn the user with non-blocking messages
506+ mInfoBar = new QgsMessageBar ( centralWidget );
507+ mInfoBar ->setSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Fixed );
508+ centralLayout->addWidget ( mInfoBar , 0 , 0 , 1 , 1 );
509+
510+ mMacrosWarn = QgsMessageBar::createMessage ( tr ( " Security warning:" ),
511+ tr ( " macros have been disabled." ),
512+ QgsApplication::getThemeIcon ( " /mIconWarn.png" ),
513+ mInfoBar );
514+
515+ QToolButton *btnEnableMacros = new QToolButton ( mMacrosWarn );
516+ btnEnableMacros->setText ( tr ( " Enable" ) );
517+ btnEnableMacros->setStyleSheet ( " background-color: rgba(255, 255, 255, 0);text-decoration: underline;" );
518+ btnEnableMacros->setCursor ( Qt::PointingHandCursor );
519+ connect ( btnEnableMacros, SIGNAL ( clicked () ), mInfoBar , SLOT ( popWidget () ) );
520+ connect ( btnEnableMacros, SIGNAL ( clicked () ), this , SLOT ( enableProjectMacros () ) );
521+ mMacrosWarn ->layout ()->addWidget ( btnEnableMacros );
522+
521523 addDockWidget ( Qt::LeftDockWidgetArea, mUndoWidget );
522524 mUndoWidget ->hide ();
523525
0 commit comments