Skip to content

Commit

Permalink
Some cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenD98 committed Sep 1, 2024
1 parent 2bb7bfd commit ed9de05
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/core/positioning/positioningmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ void PositioningModel::refreshData()
// updateInfo( key, value );
// }

bool coordinatesIsXY = CoordinateReferenceSystemUtils::defaultCoordinateOrderForCrsIsXY( coordinateDisplayCrs() );
bool coordinatesIsGeographic = coordinateDisplayCrs().isGeographic();
QgsPoint coordinates = GeometryUtils::reprojectPoint( positioningSource()->sourcePosition(), CoordinateReferenceSystemUtils::wgs84Crs(), coordinateDisplayCrs() );
double distanceUnitFactor = QgsUnitTypes::fromUnitToUnitFactor( Qgis::DistanceUnit::Meters, distanceUnits() );
QString distanceUnitAbbreviation = QgsUnitTypes::toAbbreviatedString( distanceUnits() );
const bool coordinatesIsXY = CoordinateReferenceSystemUtils::defaultCoordinateOrderForCrsIsXY( coordinateDisplayCrs() );
const bool coordinatesIsGeographic = coordinateDisplayCrs().isGeographic();
const QgsPoint coordinates = GeometryUtils::reprojectPoint( positioningSource()->sourcePosition(), CoordinateReferenceSystemUtils::wgs84Crs(), coordinateDisplayCrs() );
const double distanceUnitFactor = QgsUnitTypes::fromUnitToUnitFactor( Qgis::DistanceUnit::Meters, distanceUnits() );
const QString distanceUnitAbbreviation = QgsUnitTypes::toAbbreviatedString( distanceUnits() );

QString coord1Label;
QString coord2Label;
Expand Down
2 changes: 1 addition & 1 deletion src/qml/InformationDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Item {
PositioningInformationView {
id: positioningInformationView
width: parent.width
height: 200 // contentHeight
height: Math.min(contentHeight, mainWindow.height / 3)
visible: positioningInformationViewEnabled
positionSource: controller.positionSource
antennaHeight: positioningSettings.antennaHeightActivated ? positioningSettings.antennaHeight : -1
Expand Down
22 changes: 11 additions & 11 deletions src/qml/PositioningInformationView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Rectangle {

property alias positionSource: positioningModel.positioningSource
property alias antennaHeight: positioningModel.antennaHeight
property real contentHeight: grid.contentHeight

property color backgroundColor: "transparent"
property color alternateBackgroundColor: Theme.positionBackgroundColor
property color textColor: positionSource.currentness ? Theme.mainTextColor : Theme.secondaryTextColor
Expand All @@ -22,6 +24,14 @@ Rectangle {

GridView {
id: grid

readonly property real numberOfColumns: parent.width / cellWidth

model: PositioningModel {
id: positioningModel
distanceUnits: projectInfo.distanceUnits
coordinateDisplayCrs: projectInfo.coordinateDisplayCrs
}
anchors.fill: parent
cellHeight: positioningInformationView.cellHeight
cellWidth: {
Expand All @@ -37,24 +47,14 @@ Rectangle {
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: QfScrollBar {
}
model: PositioningModel {
id: positioningModel

distanceUnits: projectInfo.distanceUnits
coordinateDisplayCrs: projectInfo.coordinateDisplayCrs
}

Component.onCompleted: {
positioningModel.setupConnections();
}

property real numberOfColumns: parent.width / cellWidth

delegate: Rectangle {
width: grid.cellWidth
height: grid.cellHeight

property real currentRow: parseInt(index / grid.numberOfColumns)
readonly property real currentRow: parseInt(index / grid.numberOfColumns)

color: {
if (grid.numberOfColumns % 2 == 0) {
Expand Down

0 comments on commit ed9de05

Please sign in to comment.