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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ QgsMessageBar::QgsMessageBar( QWidget *parent )
setLayout( mLayout ); setLayout( mLayout );


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


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