diff --git a/apps/widgps/README.md b/apps/widgps/README.md index 81a24100b..b963fd638 100644 --- a/apps/widgps/README.md +++ b/apps/widgps/README.md @@ -14,6 +14,7 @@ There are two icons which can be used to visualize the GPS/GNSS status: - Shows in green when the GPS is on and has a fix 2. Different place markers depending on GPS/GNSS status +You can also choose to hide the icon when the GPS is off in the settings. Written by: [Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS @@ -21,4 +22,6 @@ Forum](http://forum.espruino.com/microcosms/1424/) Extended by Marco ([myxor](https://github.com/myxor)) +Extended by khromov ([myxor](https://github.com/khromov)) + Place marker icons from [icons8.com](https://icons8.com/icon/set/maps/material-outlined). diff --git a/apps/widgps/default.json b/apps/widgps/default.json index d1ab3f797..28482ddb0 100644 --- a/apps/widgps/default.json +++ b/apps/widgps/default.json @@ -1 +1 @@ -{"crossIcon": "true"} +{"crossIcon": true, "hideWhenGpsOff": false} \ No newline at end of file diff --git a/apps/widgps/metadata.json b/apps/widgps/metadata.json index 144dd6cc6..14cdb81d4 100644 --- a/apps/widgps/metadata.json +++ b/apps/widgps/metadata.json @@ -1,7 +1,7 @@ { "id": "widgps", "name": "GPS Widget", - "version": "0.07", + "version": "0.08", "description": "Tiny widget to show the power and fix status of the GPS/GNSS", "icon": "widget.png", "type": "widget", diff --git a/apps/widgps/settings.js b/apps/widgps/settings.js index 4cd9e0b83..8966a93f8 100644 --- a/apps/widgps/settings.js +++ b/apps/widgps/settings.js @@ -23,6 +23,10 @@ var mainmenu = { value : !!settings.crossIcon , onchange : v => { writeSettings("crossIcon", v); } }, + "Hide icon when GPS off" : { + value : !!settings.hideWhenGpsOff , + onchange : v => { writeSettings("hideWhenGpsOff", v); } + }, }; E.showMenu(mainmenu); }); diff --git a/apps/widgps/widget.js b/apps/widgps/widget.js index fd9b44484..f4ced5ee2 100644 --- a/apps/widgps/widget.js +++ b/apps/widgps/widget.js @@ -1,6 +1,6 @@ (function() { let settings = - require("Storage").readJSON("widgps.json", 1) || {crossIcon : true}; + require("Storage").readJSON("widgps.json", 1) || {crossIcon: true, hideWhenGpsOff: false}; var interval; @@ -59,9 +59,11 @@ WIDGETS.gps = { } } else { // GNSS off - g.drawImage( - atob("GBiBAAAAAAAAAAB+ABj/ABxDgA4AwAcAwAeMYAfEYAbgYAZwYAM4wAMcQAOOAAGHAAHDgADDwABm4AB+cAA8OAAYGAAAAAAAAAAAAA=="), - this.x, 2 + this.y); + if(!settings.hideWhenGpsOff) { + g.drawImage( + atob("GBiBAAAAAAAAAAB+ABj/ABxDgA4AwAcAwAeMYAfEYAbgYAZwYAM4wAMcQAOOAAGHAAHDgADDwABm4AB+cAA8OAAYGAAAAAAAAAAAAA=="), + this.x, 2 + this.y); + } } } }