Merge pull request #2108 from nxdefiant/widgps

widgps: Do not take widget space if icon is hidden
pull/2110/head^2
Gordon Williams 2022-09-05 11:26:36 +01:00 committed by GitHub
commit 982d252a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -5,4 +5,5 @@
0.05: Don't poll for GPS status, override setGPSPower handler (fix #1456)
0.06: Periodically update so the always on display does show current GPS fix
0.07: Alternative marker icon (configurable via settings)
0.08: Add ability to hide the icon when GPS is off, for a cleaner appearance.
0.08: Add ability to hide the icon when GPS is off, for a cleaner appearance.
0.09: Do not take widget space if icon is hidden

View File

@ -1,7 +1,7 @@
{
"id": "widgps",
"name": "GPS Widget",
"version": "0.08",
"version": "0.09",
"description": "Tiny widget to show the power and fix status of the GPS/GNSS",
"icon": "widget.png",
"type": "widget",

View File

@ -11,13 +11,14 @@ var interval;
var oldSetGPSPower = Bangle.setGPSPower;
Bangle.setGPSPower = function(on, id) {
var isGPSon = oldSetGPSPower(on, id);
WIDGETS.gps.draw();
WIDGETS.gps.width = !isGPSon && settings.hideWhenGpsOff ? 0 : 24;
Bangle.drawWidgets();
return isGPSon;
};
WIDGETS.gps = {
area : "tr",
width : 24,
width : !Bangle.isGPSOn() && settings.hideWhenGpsOff ? 0 : 24,
draw : function() {
g.reset();