Showing with 12 additions and 0 deletions.
  1. +10 −0 src/app/qgisapp.cpp
  2. +2 −0 src/app/qgisapp.h
10 changes: 10 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,9 @@ void QgisApp::createStatusBar()
mScaleEdit = new QgsScaleComboBox( statusBar() );
mScaleEdit->setObjectName( "mScaleEdit" );
mScaleEdit->setFont( myFont );
// seems setFont() change font only for popup not for line edit,
// so we need to set font for it separately
mScaleEdit->lineEdit()->setFont( myFont );
mScaleEdit->setMinimumWidth( 10 );
mScaleEdit->setMaximumWidth( 100 );
mScaleEdit->setMaximumHeight( 20 );
Expand Down Expand Up @@ -4444,6 +4447,8 @@ void QgisApp::showScale( double theScale )
else
mScaleEdit->setEditText( tr( "Invalid scale" ) );

mOldScale = mScaleEdit->currentText();

if ( mScaleEdit->width() > mScaleEdit->minimumWidth() )
{
mScaleEdit->setMinimumWidth( mScaleEdit->width() );
Expand All @@ -4452,6 +4457,11 @@ void QgisApp::showScale( double theScale )

void QgisApp::userScale()
{
if ( mOldScale == mScaleEdit->currentText() )
{
return;
}

QStringList parts = mScaleEdit->currentText().split( ':' );
if ( parts.size() == 2 )
{
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
void projectChanged( const QDomDocument & );

bool cmpByText( QAction* a, QAction* b );

QString mOldScale;
};

#ifdef ANDROID
Expand Down