qmsched: Correctly size widget on load
parent
6b2f8e98d3
commit
6d49e1d466
|
|
@ -3870,7 +3870,7 @@
|
|||
"id": "qmsched",
|
||||
"name": "Quiet Mode Schedule and Widget",
|
||||
"shortName": "Quiet Mode",
|
||||
"version": "0.04",
|
||||
"version": "0.05",
|
||||
"description": "Automatically turn Quiet Mode on or off at set times, and change LCD options while Quiet Mode is active.",
|
||||
"icon": "app.png",
|
||||
"screenshots": [{"url":"screenshot_b1_main.png"},{"url":"screenshot_b1_edit.png"},{"url":"screenshot_b1_lcd.png"},
|
||||
|
|
|
|||
|
|
@ -2,3 +2,4 @@
|
|||
0.02: Add widget
|
||||
0.03: Bangle.js 2 support
|
||||
0.04: Move Quiet Mode LCD options from global settings to this app
|
||||
0.05: Avoid immediately redrawing widgets on load
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
WIDGETS["qmsched"] = {
|
||||
area: "tl", width: 24, draw: function() {
|
||||
(function() {
|
||||
WIDGETS["qmsched"] = {
|
||||
area: "tl",
|
||||
width: ((require("Storage").readJSON("setting.json", 1) || {}).quiet|0) ? 24 : 0,
|
||||
draw: function() {
|
||||
const mode = (require("Storage").readJSON("setting.json", 1) || {}).quiet|0;
|
||||
if (mode===0) { // Off
|
||||
if (this.width!==0) {
|
||||
|
|
@ -29,4 +32,5 @@ WIDGETS["qmsched"] = {
|
|||
.fillRect(x-1, y-5, x+1, y+5).drawLine(x, y-6, x, y+6) // top+bottom
|
||||
.drawLine(x+5, y-3, x+3, y-5).drawLine(x-5, y-3, x-3, y-5); // wriggles
|
||||
},
|
||||
};
|
||||
};
|
||||
})();
|
||||
Loading…
Reference in New Issue