Skip to content

Commit 908eaf5

Browse files
committed
Make more space available on CRS selection dialog
1 parent 0b39a2e commit 908eaf5

File tree

2 files changed

+153
-189
lines changed

2 files changed

+153
-189
lines changed

src/gui/qgsprojectionselectiontreewidget.cpp

+12-15
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ void QgsProjectionSelectionTreeWidget::applySelection( int column, QString value
277277
lstCoordinateSystems->clearSelection();
278278
lstRecent->clearSelection();
279279
teProjection->clear();
280-
teSelected->clear();
281280
}
282281
}
283282

@@ -772,7 +771,6 @@ void QgsProjectionSelectionTreeWidget::lstCoordinateSystems_currentItemChanged(
772771
// Found a real CRS
773772
emit crsSelected();
774773

775-
teSelected->setText( selectedName() );
776774
updateBoundsPreview();
777775

778776
QList<QTreeWidgetItem *> nodes = lstRecent->findItems( current->text( QgisCrsIdColumn ), Qt::MatchExactly, QgisCrsIdColumn );
@@ -790,10 +788,9 @@ void QgsProjectionSelectionTreeWidget::lstCoordinateSystems_currentItemChanged(
790788
}
791789
else
792790
{
793-
// Not an CRS - remove the highlight so the user doesn't get too confused
791+
// Not a CRS - remove the highlight so the user doesn't get too confused
794792
current->setSelected( false );
795793
teProjection->clear();
796-
teSelected->clear();
797794
lstRecent->clearSelection();
798795
}
799796
}
@@ -872,7 +869,6 @@ void QgsProjectionSelectionTreeWidget::updateFilter()
872869
{
873870
( *itr )->setSelected( false );
874871
teProjection->clear();
875-
teSelected->clear();
876872
}
877873
}
878874
else if ( ( *itr )->text( NameColumn ).contains( re )
@@ -996,6 +992,7 @@ void QgsProjectionSelectionTreeWidget::updateBoundsPreview()
996992
return;
997993

998994
QgsRectangle rect = currentCrs.bounds();
995+
QString extentString = tr( "Extent not known" );
999996
if ( !qgsDoubleNear( rect.area(), 0.0 ) )
1000997
{
1001998
QgsGeometry geom;
@@ -1017,22 +1014,22 @@ void QgsProjectionSelectionTreeWidget::updateBoundsPreview()
10171014
mAreaCanvas->setExtent( extent );
10181015
mAreaCanvas->refresh();
10191016
mPreviewBand->show();
1020-
QString extentString = tr( "Extent: %1, %2, %3, %4" )
1021-
.arg( rect.xMinimum(), 0, 'f', 2 )
1022-
.arg( rect.yMinimum(), 0, 'f', 2 )
1023-
.arg( rect.xMaximum(), 0, 'f', 2 )
1024-
.arg( rect.yMaximum(), 0, 'f', 2 );
1025-
QString proj4String = tr( "Proj4: %1" ).arg( selectedProj4String() );
1026-
teProjection->setText( extentString + "\n" + proj4String );
1017+
extentString = QStringLiteral( "%1, %2, %3, %4" )
1018+
.arg( rect.xMinimum(), 0, 'f', 2 )
1019+
.arg( rect.yMinimum(), 0, 'f', 2 )
1020+
.arg( rect.xMaximum(), 0, 'f', 2 )
1021+
.arg( rect.yMaximum(), 0, 'f', 2 );
1022+
10271023
}
10281024
else
10291025
{
10301026
mPreviewBand->hide();
10311027
mAreaCanvas->zoomToFullExtent();
1032-
QString extentString = tr( "Extent: Extent not known" );
1033-
QString proj4String = tr( "Proj4: %1" ).arg( selectedProj4String() );
1034-
teProjection->setText( extentString + "\n" + proj4String );
10351028
}
1029+
1030+
QString extentHtml = QStringLiteral( "<dt><b>%1</b></dt><dd>%2</dd>" ).arg( tr( "Extent" ), extentString );
1031+
QString proj4String = tr( "<dt><b>%1</b></dt><dd>%2</dd>" ).arg( tr( "Proj4" ), selectedProj4String() );
1032+
teProjection->setText( QStringLiteral( "<h3>%1</h3><dl>" ).arg( selectedName() ) + extentHtml + proj4String + QLatin1String( "</dl>" ) );
10361033
}
10371034

10381035
QStringList QgsProjectionSelectionTreeWidget::authorities()

0 commit comments

Comments
 (0)