mirror of https://github.com/espruino/BangleApps
widgps: Do not take widget space if icon is hidden
parent
58a200b05d
commit
bd829f27e9
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -6,3 +6,4 @@
|
|||
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.09: Do not take widget space if icon is hidden
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue