From fa3b6265778437210b92767eebd610a802b8fc07 Mon Sep 17 00:00:00 2001 From: PeterPetrik Date: Thu, 4 Apr 2024 10:54:33 +0200 Subject: [PATCH] small tweaks to GPS panel --- app/qml/gps/MMPositionProviderPage.qml | 48 ++++++++++++-------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/app/qml/gps/MMPositionProviderPage.qml b/app/qml/gps/MMPositionProviderPage.qml index 5c584e1e2..dca1a6c7a 100644 --- a/app/qml/gps/MMPositionProviderPage.qml +++ b/app/qml/gps/MMPositionProviderPage.qml @@ -32,6 +32,8 @@ MMComponents.MMPage { property bool showTopTitle: visibleArea.yPosition * height > ( headerItem.contentHeight / 2 ) + visible: __haveBluetooth + width: parent.width height: parent.height @@ -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 ) } @@ -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 @@ -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 @@ -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