Skip to content

Commit 8be777b

Browse files
dakcartobrushtyler
authored andcommitted
Changes to QgsMessageBar icons and Enable macros action
1 parent 54275e0 commit 8be777b

File tree

7 files changed

+25
-18
lines changed

7 files changed

+25
-18
lines changed

images/images.qrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
<file>themes/default/mActionZoomOut.png</file>
169169
<file>themes/default/mActionZoomToLayer.png</file>
170170
<file>themes/default/mActionZoomToSelected.png</file>
171+
<file>themes/default/mIconClose.png</file>
171172
<file>themes/default/mIconConnect.png</file>
172173
<file>themes/default/mIconDbSchema.png</file>
173174
<file>themes/default/mIconDelete.png</file>
@@ -369,6 +370,7 @@
369370
<file>themes/gis/mActionZoomOut.png</file>
370371
<file>themes/gis/mActionZoomToLayer.png</file>
371372
<file>themes/gis/mActionZoomToSelected.png</file>
373+
<file>themes/gis/mIconClose.png</file>
372374
<file>themes/gis/mIconEditable.png</file>
373375
<file>themes/gis/mIconLineLayer.png</file>
374376
<file>themes/gis/mIconPointLayer.png</file>
@@ -400,6 +402,7 @@
400402
<file>themes/gis/mIconWcs.png</file>
401403
<file>themes/gis/mIconWms.png</file>
402404
<file>themes/gis/mIconWfs.png</file>
405+
<file>themes/gis/mIconWarn.png</file>
403406
<file>themes/gis/mIconSpatialite.png</file>
404407
<file>themes/gis/mIconRaster.png</file>
405408
<file>themes/gis/mIconPostgis.png</file>
502 Bytes
Loading
439 Bytes
Loading

images/themes/gis/mIconClose.png

502 Bytes
Loading

images/themes/gis/mIconWarn.png

658 Bytes
Loading

src/app/qgisapp.cpp

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/app/qgsmessagebar.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ QgsMessageBar::QgsMessageBar( QWidget *parent )
4343
mLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ), 0, 1, 1, 1 );
4444

4545
mCloseBtn = new QToolButton( this );
46-
mCloseBtn->setText( tr( "Close" ) );
47-
mCloseBtn->setIcon( QgsApplication::getThemeIcon( "mIconClose.png" ) );
46+
mCloseBtn->setText( tr( "" ) );
47+
mCloseBtn->setStyleSheet( "background-color: rgba(255, 255, 255, 0);" );
48+
mCloseBtn->setCursor( Qt::PointingHandCursor );
49+
mCloseBtn->setIcon( QgsApplication::getThemeIcon( "/mIconClose.png" ) );
4850
connect( mCloseBtn, SIGNAL( clicked() ), this, SLOT( popWidget() ) );
4951
mLayout->addWidget( mCloseBtn, 0, 2, 1, 1 );
5052

0 commit comments

Comments
 (0)