Skip to content

Commit 228a4ee

Browse files
committed
Fix some minor messagebar issues
1 parent bfed787 commit 228a4ee

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/gui/qgsmessagebar.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ QgsMessageBar::QgsMessageBar( QWidget *parent )
4646
setLayout( mLayout );
4747

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

106105
void QgsMessageBar::mousePressEvent( QMouseEvent * e )
107106
{
108-
// stop/start mCountdownTimer
109-
QProgressBar *pb = static_cast<QProgressBar *>( childAt( e->pos() ) );
110-
if ( pb && pb->objectName() == QString( "mCountdown" ) && e->button() == Qt::LeftButton )
107+
if ( mCountProgress == childAt( e->pos() ) && e->button() == Qt::LeftButton )
111108
{
112109
if ( mCountdownTimer->isActive() )
113110
{
114111
mCountdownTimer->stop();
115-
pb->setStyleSheet( mCountStyleSheet.arg( "mIconTimerContinue.png" ) );
112+
mCountProgress->setStyleSheet( mCountStyleSheet.arg( "mIconTimerContinue.png" ) );
116113
}
117114
else
118115
{
119116
mCountdownTimer->start();
120-
pb->setStyleSheet( mCountStyleSheet.arg( "mIconTimerPause.png" ) );
117+
mCountProgress->setStyleSheet( mCountStyleSheet.arg( "mIconTimerPause.png" ) );
121118
}
122119
}
123120
}

0 commit comments

Comments
 (0)