Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small tweaks to GPS panel #3238

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 23 additions & 25 deletions app/qml/gps/MMPositionProviderPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ MMComponents.MMPage {

property bool showTopTitle: visibleArea.yPosition * height > ( headerItem.contentHeight / 2 )

visible: __haveBluetooth

width: parent.width
height: parent.height

Expand Down Expand Up @@ -81,6 +83,7 @@ MMComponents.MMPage {
secondaryText: listdelegate.isActive ? __positionKit.positionProvider.stateMessage : model.ProviderDescription

rightContent: MMComponents.MMRoundButton {
visible: model.ProviderType !== "internal"
iconSource: __style.deleteIcon
onClicked: removeDialog.openDialog( model.ProviderId )
}
Expand Down Expand Up @@ -113,12 +116,16 @@ MMComponents.MMPage {
}
}

footer: __haveBluetooth ? connectionPossibleFooterComponent : noConnectionPossibleFooterComponent
footer: MMComponents.MMListSpacer {
height: __style.safeAreaBottom + __style.margin8 + connectNewReceiverButton.height
}
}

MMComponents.MMButton {
id: connectNewReceiverButton

visible: listview.visible

width: parent.width
anchors {
bottom: parent.bottom
Expand All @@ -130,6 +137,21 @@ MMComponents.MMPage {
onClicked: bluetoothDiscoveryLoader.active = true
}

MMComponents.MMMessage {
visible: !listview.visible
width: parent.width
anchors.centerIn: parent

image: __style.externalGpsRedImage
title: qsTr( "Connecting to external receivers via bluetooth is not supported" )
description: qsTr( "This function is not available on iOS. " +
"Your hardware vendor may provide a custom " +
"app that connects to the receiver and sets position. " +
"Mergin Maps will still think it is the internal GPS of " +
"your phone/tablet." )
link: __inputHelp.howToConnectGPSLink
}

MMDialogs.MMProviderRemoveReceiverDialog {
id: removeDialog

Expand Down Expand Up @@ -177,30 +199,6 @@ MMComponents.MMPage {
}
}

Component {
id: noConnectionPossibleFooterComponent

MMComponents.MMMessage {
width: ListView.view.width
image: __style.externalGpsRedImage
title: qsTr( "Connecting to external receivers via bluetooth is not supported" )
description: qsTr( "This function is not available on iOS. " +
"Your hardware vendor may provide a custom " +
"app that connects to the receiver and sets position. " +
"Mergin Maps will still think it is the internal GPS of " +
"your phone/tablet." )
link: __inputHelp.howToConnectGPSLink
}
}

Component {
id: connectionPossibleFooterComponent

MMComponents.MMListSpacer {
height: __style.safeAreaBottom + __style.margin8 + connectNewReceiverButton.height
}
}

Component {
id: bluetoothDiscoveryDrawerComponent

Expand Down
Loading