-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redesign of the GPS Data Page (#3039)
Added new GpsDataDrawer - redesign of GpsDataPage to GalleryApp
- Loading branch information
1 parent
e4b5d28
commit 0a91c56
Showing
11 changed files
with
518 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,307 @@ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Controls.Basic | ||
import QtQuick.Layouts | ||
import "." | ||
import ".." | ||
import lc 1.0 | ||
|
||
Drawer { | ||
id: root | ||
|
||
property var title | ||
property real rowHeight: 67 * __dp | ||
|
||
width: ApplicationWindow.window.width | ||
height: (mainColumn.height > ApplicationWindow.window.height ? ApplicationWindow.window.height : mainColumn.height) - 20 * __dp | ||
edge: Qt.BottomEdge | ||
|
||
Rectangle { | ||
color: roundedRect.color | ||
anchors.top: parent.top | ||
anchors.left: parent.left | ||
anchors.right: parent.right | ||
height: 2 * radius | ||
anchors.topMargin: -radius | ||
radius: 20 * __dp | ||
} | ||
|
||
Rectangle { | ||
|
||
id: roundedRect | ||
|
||
anchors.fill: parent | ||
color: __style.whiteColor | ||
|
||
ColumnLayout { | ||
|
||
id: mainColumn | ||
|
||
width: parent.width | ||
spacing: 40 * __dp | ||
|
||
MMHeader { | ||
id: header | ||
|
||
rightMarginShift: 0 | ||
backVisible: false | ||
|
||
title: qsTr("GPS info") | ||
titleFont: __style.h3 | ||
|
||
MMRoundButton { | ||
id: backBtn | ||
|
||
anchors.right: parent.right | ||
anchors.rightMargin: __style.pageMargins | ||
anchors.verticalCenter: parent.verticalCenter | ||
|
||
iconSource: __style.closeIcon | ||
iconColor: __style.forestColor | ||
|
||
bgndColor: __style.lightGreenColor | ||
bgndHoverColor: __style.mediumGreenColor | ||
|
||
onClicked: root.visible = false | ||
} | ||
} | ||
|
||
ScrollView { | ||
id: scrollView | ||
|
||
Layout.fillWidth: true | ||
Layout.leftMargin: 20 * __dp | ||
Layout.rightMargin: 20 * __dp | ||
Layout.maximumWidth: __style.maxPageWidth | ||
Layout.alignment: Qt.AlignHCenter | ||
Layout.preferredHeight: { | ||
if (ApplicationWindow.window){ | ||
var availableHeight = ApplicationWindow.window.height - header.height - mainColumn.spacing | ||
var totalHeight = scrollColumn.childrenRect.height + 20 * __dp | ||
|
||
if(totalHeight >= ApplicationWindow.window.height) { | ||
return availableHeight | ||
} | ||
return totalHeight | ||
} | ||
return 0 | ||
} | ||
contentWidth: availableWidth | ||
contentHeight: scrollColumn.childrenRect.height | ||
|
||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff | ||
ScrollBar.vertical.policy: ScrollBar.AlwaysOff | ||
|
||
Column{ | ||
id: scrollColumn | ||
|
||
width: parent.width | ||
spacing: 0 | ||
|
||
Row { | ||
width: parent.width | ||
height: rowHeight | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Source" ) | ||
descriptionText: __positionKit.positionProvider ? __positionKit.providerName : qsTr( "No receiver" ) | ||
} | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Status" ) | ||
descriptionText: __positionKit.positionProvider ? __positionKit.providerMessage : "" | ||
alignmentRight: true | ||
itemVisible: __positionKit.positionProvider && __positionKit.providerType === "external" | ||
} | ||
} | ||
|
||
MMLine {} | ||
|
||
Row { | ||
width: parent.width | ||
height: rowHeight | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Latitude" ) | ||
descriptionText: { | ||
if ( !__positionKit.hasPosition || Number.isNaN( __positionKit.latitude ) ) { | ||
qsTr( "N/A" ) | ||
} | ||
__positionKit.latitude | ||
} | ||
} | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Longitude") | ||
descriptionText: { | ||
if ( !__positionKit.hasPosition || Number.isNaN( __positionKit.longitude ) ) { | ||
qsTr( "N/A" ) | ||
} | ||
__positionKit.longitude | ||
} | ||
alignmentRight: true | ||
} | ||
} | ||
|
||
MMLine {} | ||
|
||
Row { | ||
width: parent.width | ||
height: rowHeight | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "X" ) | ||
descriptionText: { | ||
if ( !__positionKit.hasPosition || Number.isNaN( __positionKit.x ) ) { | ||
qsTr( "N/A" ) | ||
} | ||
__positionKit.x.toFixed(2) | ||
} | ||
} | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Y" ) | ||
descriptionText: { | ||
if ( !__positionKit.hasPosition || Number.isNaN( __positionKit.x ) ) { | ||
qsTr( "N/A" ) | ||
} | ||
__positionKit.y.toFixed(2) | ||
} | ||
alignmentRight: true | ||
} | ||
} | ||
|
||
MMLine {} | ||
|
||
Row { | ||
width: parent.width | ||
height: rowHeight | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Horizontal accuracy" ) | ||
descriptionText: { | ||
if ( !__positionKit.hasPosition || __positionKit.horizontalAccuracy < 0 ) { | ||
return qsTr( "N/A" ) | ||
} | ||
|
||
__positionKit.horizontalAccuracy.toFixed(2) + " m" | ||
} | ||
} | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Vertical accuracy" ) | ||
descriptionText: { | ||
if ( !__positionKit.hasPosition || __positionKit.verticalAccuracy < 0 ) { | ||
return qsTr( "N/A" ) | ||
} | ||
|
||
__positionKit.verticalAccuracy.toFixed(2) + " m" | ||
} | ||
alignmentRight: true | ||
} | ||
} | ||
|
||
MMLine {} | ||
|
||
Row { | ||
width: parent.width | ||
height: rowHeight | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Altitude" ) | ||
descriptionText: { | ||
if ( !__positionKit.hasPosition || Number.isNaN( __positionKit.altitude ) ) { | ||
return qsTr( "N/A" ) | ||
} | ||
__positionKit.altitude.toString() + " m" | ||
} | ||
} | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Satellites (in use/view)" ) | ||
descriptionText: { | ||
if ( __positionKit.satellitesUsed < 0 || __positionKit.satellitesVisible < 0 ) | ||
{ | ||
return qsTr( "N/A" ) | ||
} | ||
|
||
__positionKit.satellitesUsed + "/" + __positionKit.satellitesVisible | ||
} | ||
alignmentRight: true | ||
} | ||
} | ||
|
||
MMLine {} | ||
|
||
Row { | ||
width: parent.width | ||
height: rowHeight | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Speed" ) | ||
descriptionText: { | ||
if ( !__positionKit.hasPosition || __positionKit.speed < 0 ) { | ||
return qsTr( "N/A" ) | ||
} | ||
|
||
__positionKit.speed.toString(2) + " km/h" | ||
} | ||
} | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "Last Fix" ) | ||
descriptionText: __positionKit.lastRead || qsTr( "N/A" ) | ||
alignmentRight: true | ||
} | ||
} | ||
|
||
MMLine {} | ||
|
||
Row { | ||
width: parent.width | ||
height: rowHeight | ||
|
||
MMGpsDataText{ | ||
titleText: qsTr( "GPS antenna height" ) | ||
descriptionText: __positionKit.gpsAntennaHeight > 0 ? __positionKit.gpsAntennaHeight.toString(3) + " m" : qsTr( "Not set" ) | ||
} | ||
} | ||
|
||
Item { | ||
width: 1 | ||
height: 20 * __dp | ||
} | ||
|
||
MMButton { | ||
id: primaryButton | ||
|
||
width: parent.width - 2 * 20 * __dp | ||
anchors.horizontalCenter: parent.horizontalCenter | ||
anchors.bottomMargin: 20 | ||
|
||
text: qsTr("Manage GPS receivers") | ||
|
||
onClicked: { | ||
console.log("GPS data drawer button test OK") | ||
} | ||
} | ||
|
||
Item { | ||
width: 2 | ||
height: 20 * __dp | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
import QtQuick | ||
import "." | ||
import ".." | ||
import lc 1.0 | ||
import QtQuick.Layouts | ||
|
||
Item { | ||
property string titleText: "title" | ||
property string descriptionText: "description" | ||
property bool alignmentRight: false | ||
property bool itemVisible: true | ||
|
||
width: parent.width / 2 | ||
height: parent.height | ||
|
||
ColumnLayout { | ||
width: parent.width | ||
height: parent.height | ||
visible: itemVisible | ||
spacing: 0 | ||
|
||
Text { | ||
text: titleText | ||
color: __style.nightColor | ||
font: __style.p6 | ||
elide: Text.ElideRight | ||
horizontalAlignment: alignmentRight ? Text.AlignRight : Text.AlignLeft | ||
Layout.fillWidth: true | ||
width: parent.width | ||
Layout.topMargin: 8 | ||
} | ||
|
||
Text { | ||
text: descriptionText | ||
color: __style.nightColor | ||
font: __style.t3 | ||
elide: Text.ElideMiddle | ||
horizontalAlignment: alignmentRight ? Text.AlignRight : Text.AlignLeft | ||
Layout.fillWidth: true | ||
width: parent.width | ||
Layout.bottomMargin: 8 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
import QtQuick | ||
import lc 1.0 | ||
|
||
Item { | ||
|
||
width: parent.width | ||
height: (1 * __dp) < 1 ? 1 : 1 * __dp | ||
|
||
Rectangle { | ||
width: parent.width | ||
height: parent.height | ||
color: __style.greyColor | ||
} | ||
} |
Oops, something went wrong.
0a91c56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS - version 24.02.515011 just submitted!