[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
This commit is contained in:
demmm 2024-03-30 20:11:48 +01:00
parent 8440a6a5dd
commit f0c2295606

View File

@ -1,6 +1,6 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2020 - 2022 Anke Boersma <demm@kaosx.us>
* SPDX-FileCopyrightText: 2020 - 2024 Anke Boersma <demm@kaosx.us>
* 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 {