0.10: Option to hide widgets, tweak top widget width to avoid overlap with hour text at 9am
parent
0f7c1d5e40
commit
1d7d9e2962
|
|
@ -10,3 +10,4 @@
|
||||||
0.08: Stability improvements - ensure we continue even if a flat string can't be allocated
|
0.08: Stability improvements - ensure we continue even if a flat string can't be allocated
|
||||||
Stop ClockInfo text drawing outside the allocated area
|
Stop ClockInfo text drawing outside the allocated area
|
||||||
0.09: Use clock_info module as an app
|
0.09: Use clock_info module as an app
|
||||||
|
0.10: Option to hide widgets, tweak top widget width to avoid overlap with hour text at 9am
|
||||||
|
|
@ -58,7 +58,8 @@ let draw = function() {
|
||||||
// Now draw this one
|
// Now draw this one
|
||||||
R = Bangle.appRect;
|
R = Bangle.appRect;
|
||||||
x = R.w / 2;
|
x = R.w / 2;
|
||||||
y = R.y + R.h / 2 - 12; // 12 = room for date
|
y = R.y + R.h / 2 - 6;
|
||||||
|
if (!settings.hideWidgets) y-= 6; // extra room for date
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
var local_time = require("locale").time(date, 1);
|
var local_time = require("locale").time(date, 1);
|
||||||
var hourStr = local_time.split(":")[0].trim().padStart(2,'0');
|
var hourStr = local_time.split(":")[0].trim().padStart(2,'0');
|
||||||
|
|
@ -77,6 +78,8 @@ let draw = function() {
|
||||||
g2.setColor(0).fillRect(0,0,g2.getWidth(),g2.getHeight()).setFontAlign(1, 0).setFont("PaytoneOne");
|
g2.setColor(0).fillRect(0,0,g2.getWidth(),g2.getHeight()).setFontAlign(1, 0).setFont("PaytoneOne");
|
||||||
g2.setColor(1).drawString(minStr, g2.getWidth()-fontBorder, g2.getHeight()/2).setFont("4x6"); // draw and unload custom font
|
g2.setColor(1).drawString(minStr, g2.getWidth()-fontBorder, g2.getHeight()/2).setFont("4x6"); // draw and unload custom font
|
||||||
g2.setColor(0).fillPoly([0,0, g2.getWidth(),0, 0,slope*2]);
|
g2.setColor(0).fillPoly([0,0, g2.getWidth(),0, 0,slope*2]);
|
||||||
|
// redraw the top widget
|
||||||
|
clockInfoMenu.redraw();
|
||||||
// start the animation *in*
|
// start the animation *in*
|
||||||
animate(true);
|
animate(true);
|
||||||
};
|
};
|
||||||
|
|
@ -141,8 +144,14 @@ let clockInfoDraw = (itm, info, options) => {
|
||||||
g.setClipRect(0,0,g.getWidth()-1, g.getHeight()-1);
|
g.setClipRect(0,0,g.getWidth()-1, g.getHeight()-1);
|
||||||
};
|
};
|
||||||
let clockInfoItems = require("clock_info").load();
|
let clockInfoItems = require("clock_info").load();
|
||||||
let clockInfoMenu = require("clock_info").addInteractive(clockInfoItems, { app:"slopeclockpp",x:126, y:24, w:50, h:40, draw : clockInfoDraw, bg : g.theme.bg, fg : g.theme.fg, hl : "#f00"/*red*/ });
|
let clockInfoMenu = require("clock_info").addInteractive(clockInfoItems, { // top right
|
||||||
let clockInfoMenu2 = require("clock_info").addInteractive(clockInfoItems, { app:"slopeclockpp",x:0, y:115, w:50, h:40, draw : clockInfoDraw, bg : bgColor, fg : g.theme.bg, hl : (bgColor=="#000")?"#f00"/*red*/:g.theme.fg });
|
app:"slopeclockpp",x:132, y:settings.hideWidgets ? 12 : 24, w:44, h:40,
|
||||||
|
draw : clockInfoDraw, bg : g.theme.bg, fg : g.theme.fg, hl : "#f00"/*red*/
|
||||||
|
});
|
||||||
|
let clockInfoMenu2 = require("clock_info").addInteractive(clockInfoItems, { // bottom left
|
||||||
|
app:"slopeclockpp",x:0, y:115, w:50, h:40,
|
||||||
|
draw : clockInfoDraw, bg : bgColor, fg : g.theme.bg, hl : (bgColor=="#000")?"#f00"/*red*/:g.theme.fg
|
||||||
|
});
|
||||||
|
|
||||||
// Show launcher when middle button pressed
|
// Show launcher when middle button pressed
|
||||||
Bangle.setUI({
|
Bangle.setUI({
|
||||||
|
|
@ -163,6 +172,7 @@ Bangle.setUI({
|
||||||
});
|
});
|
||||||
// Load widgets
|
// Load widgets
|
||||||
Bangle.loadWidgets();
|
Bangle.loadWidgets();
|
||||||
|
if (settings.hideWidgets) require("widget_utils").swipeOn();
|
||||||
|
else setTimeout(Bangle.drawWidgets,0);
|
||||||
draw();
|
draw();
|
||||||
setTimeout(Bangle.drawWidgets,0);
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{ "id": "slopeclockpp",
|
{ "id": "slopeclockpp",
|
||||||
"name": "Slope Clock ++",
|
"name": "Slope Clock ++",
|
||||||
"version":"0.09",
|
"version":"0.10",
|
||||||
"description": "A clock where hours and minutes are divided by a sloping line. When the minute changes, the numbers slide off the screen. This is a clone of the original Slope Clock which shows extra information and allows the colors to be selected.",
|
"description": "A clock where hours and minutes are divided by a sloping line. When the minute changes, the numbers slide off the screen. This is a clone of the original Slope Clock which shows extra information and allows the colors to be selected.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"screenshots": [{"url":"screenshot.png"}],
|
"screenshots": [{"url":"screenshot.png"}],
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
|
@ -15,6 +15,10 @@
|
||||||
let menu ={
|
let menu ={
|
||||||
'': { 'title': 'Slope Clock ++' },
|
'': { 'title': 'Slope Clock ++' },
|
||||||
/*LANG*/'< Back': back,
|
/*LANG*/'< Back': back,
|
||||||
|
/*LANG*/'Hide Widgets': {
|
||||||
|
value: !!settings.hideWidgets,
|
||||||
|
onchange: x => save('hideWidgets', x),
|
||||||
|
},
|
||||||
/*LANG*/'Red': {
|
/*LANG*/'Red': {
|
||||||
value: !!settings.colorRed,
|
value: !!settings.colorRed,
|
||||||
format: () => (settings.colorRed ? 'Yes' : 'No'),
|
format: () => (settings.colorRed ? 'Yes' : 'No'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue