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.06: Periodically update so the always on display does show current GPS fix
|
||||||
0.07: Alternative marker icon (configurable via settings)
|
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
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "widgps",
|
"id": "widgps",
|
||||||
"name": "GPS Widget",
|
"name": "GPS Widget",
|
||||||
"version": "0.08",
|
"version": "0.09",
|
||||||
"description": "Tiny widget to show the power and fix status of the GPS/GNSS",
|
"description": "Tiny widget to show the power and fix status of the GPS/GNSS",
|
||||||
"icon": "widget.png",
|
"icon": "widget.png",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,14 @@ var interval;
|
||||||
var oldSetGPSPower = Bangle.setGPSPower;
|
var oldSetGPSPower = Bangle.setGPSPower;
|
||||||
Bangle.setGPSPower = function(on, id) {
|
Bangle.setGPSPower = function(on, id) {
|
||||||
var isGPSon = oldSetGPSPower(on, id);
|
var isGPSon = oldSetGPSPower(on, id);
|
||||||
WIDGETS.gps.draw();
|
WIDGETS.gps.width = !isGPSon && settings.hideWhenGpsOff ? 0 : 24;
|
||||||
|
Bangle.drawWidgets();
|
||||||
return isGPSon;
|
return isGPSon;
|
||||||
};
|
};
|
||||||
|
|
||||||
WIDGETS.gps = {
|
WIDGETS.gps = {
|
||||||
area : "tr",
|
area : "tr",
|
||||||
width : 24,
|
width : !Bangle.isGPSOn() && settings.hideWhenGpsOff ? 0 : 24,
|
||||||
draw : function() {
|
draw : function() {
|
||||||
g.reset();
|
g.reset();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue