From f0c2295606bb1a8efecf0bc91bda4029c498d728 Mon Sep 17 00:00:00 2001 From: demmm Date: Sat, 30 Mar 2024 20:11:48 +0100 Subject: [PATCH] [localeq]Map-qt6 needed changes for Qt6 & Wayland dragging & zooming now needs QML entries osm is the only qtlocation provided map plugin, preferred thus useless now no solution yet for warning (API key required), upstream bug reports offer no fix, example https://bugreports.qt.io/browse/QTBUG-115742 --- src/modules/localeq/Map-qt6.qml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/modules/localeq/Map-qt6.qml b/src/modules/localeq/Map-qt6.qml index b485dcadf..1e7b489e5 100644 --- a/src/modules/localeq/Map-qt6.qml +++ b/src/modules/localeq/Map-qt6.qml @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * SPDX-FileCopyrightText: 2020 - 2022 Anke Boersma + * SPDX-FileCopyrightText: 2020 - 2024 Anke Boersma * SPDX-License-Identifier: GPL-3.0-or-later * * Calamares is Free Software: see the License-Identifier above. @@ -89,7 +89,7 @@ Column { console.log("Online lookup", latC, lonC) // Needs to move to localeq.conf, each distribution will need their own account - xhr.open("GET", "http://api.geonames.org/timezoneJSON?lat=" + latC + "&lng=" + lonC + "&username=SOME_USERNAME") + xhr.open("GET", "https://api.geonames.org/timezoneJSON?lat=" + latC + "&lng=" + lonC + "&username=SOME_USERNAME") xhr.send() } @@ -112,7 +112,7 @@ Column { Plugin { id: mapPlugin - preferred: ["osm", "esri"] // "esri", "here", "itemsoverlay", "mapbox", "mapboxgl", "osm" + name: ["osm"] } Map { @@ -177,6 +177,30 @@ Column { getTzOffline(); } } + + WheelHandler { + id: wheel + acceptedDevices: Qt.platform.pluginName === "cocoa" || Qt.platform.pluginName === "wayland" + ? PointerDevice.Mouse | PointerDevice.TouchPad + : PointerDevice.Mouse + rotationScale: 1/120 + property: "zoomLevel" + } + DragHandler { + id: drag + target: null + onTranslationChanged: (delta) => map.pan(-delta.x, -delta.y) + } + Shortcut { + enabled: map.zoomLevel < map.maximumZoomLevel + sequence: StandardKey.ZoomIn + onActivated: map.zoomLevel = Math.round(map.zoomLevel + 1) + } + Shortcut { + enabled: map.zoomLevel > map.minimumZoomLevel + sequence: StandardKey.ZoomOut + onActivated: map.zoomLevel = Math.round(map.zoomLevel - 1) + } } Column {