Skip to content

Commit 822f324

Browse files
committed
message log status bar icon:
- hide by default - show when new messages arrive while log is closed - hide when message log is opened
1 parent 6b07241 commit 822f324

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gui/qgsmessagelogviewer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ QgsMessageLogViewer::QgsMessageLogViewer( QStatusBar *statusBar, QWidget *parent
5858
mButton->setIcon( icon( "/mIconWarn.png" ) );
5959
mButton->setToolTip( tr( "No messages." ) );
6060
mButton->setCheckable( true );
61+
mButton->hide();
6162
connect( mButton, SIGNAL( toggled( bool ) ), this, SLOT( buttonToggled( bool ) ) );
6263
statusBar->addPermanentWidget( mButton, 0 );
6364
}
@@ -82,6 +83,7 @@ void QgsMessageLogViewer::showEvent( QShowEvent * )
8283
if ( mButton )
8384
{
8485
mButton->setChecked( true );
86+
mButton->hide();
8587
}
8688
}
8789

@@ -102,8 +104,9 @@ void QgsMessageLogViewer::logMessage( QString message, QString tag, int level )
102104
{
103105
mButton->setToolTip( tr( "%1 message(s) logged." ).arg( mCount++ ) );
104106

105-
if ( mButton && !isVisible() )
107+
if ( !isVisible() )
106108
{
109+
mButton->show();
107110
QToolTip::showText( mButton->mapToGlobal( QPoint( 0, 0 ) ), mButton->toolTip() );
108111
}
109112

0 commit comments

Comments
 (0)