Skip to content

Commit

Permalink
Fix some minor messagebar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 12, 2013
1 parent bfed787 commit 228a4ee
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/gui/qgsmessagebar.cpp
Expand Up @@ -46,7 +46,6 @@ QgsMessageBar::QgsMessageBar( QWidget *parent )
setLayout( mLayout );

mCountProgress = new QProgressBar( this );
mCountProgress->setObjectName( "mCountProgress" );
mCountStyleSheet = QString( "QProgressBar { border: 1px solid rgba(0, 0, 0, 75%);"
" border-radius: 2px; background: rgba(0, 0, 0, 0);"
" image: url(:/images/themes/default/%1) }"
Expand Down Expand Up @@ -105,19 +104,17 @@ QgsMessageBar::~QgsMessageBar()

void QgsMessageBar::mousePressEvent( QMouseEvent * e )
{
// stop/start mCountdownTimer
QProgressBar *pb = static_cast<QProgressBar *>( childAt( e->pos() ) );
if ( pb && pb->objectName() == QString( "mCountdown" ) && e->button() == Qt::LeftButton )
if ( mCountProgress == childAt( e->pos() ) && e->button() == Qt::LeftButton )
{
if ( mCountdownTimer->isActive() )
{
mCountdownTimer->stop();
pb->setStyleSheet( mCountStyleSheet.arg( "mIconTimerContinue.png" ) );
mCountProgress->setStyleSheet( mCountStyleSheet.arg( "mIconTimerContinue.png" ) );
}
else
{
mCountdownTimer->start();
pb->setStyleSheet( mCountStyleSheet.arg( "mIconTimerPause.png" ) );
mCountProgress->setStyleSheet( mCountStyleSheet.arg( "mIconTimerPause.png" ) );
}
}
}
Expand Down

0 comments on commit 228a4ee

Please sign in to comment.