forked from FOSS/BangleApps
Fix timelines
parent
97785aadbd
commit
5977d9b412
|
@ -3,8 +3,9 @@ const storage = require("Storage");
|
||||||
const SCREEN_WIDTH = g.getWidth();
|
const SCREEN_WIDTH = g.getWidth();
|
||||||
const SCREEN_HEIGHT = g.getHeight();
|
const SCREEN_HEIGHT = g.getHeight();
|
||||||
|
|
||||||
const WIDGETS_HEIGHT = 25;
|
const TOP_SPACING = 5;
|
||||||
const DATETIME_SPACING_HEIGHT = 10;
|
const WIDGETS_HEIGHT = 20;
|
||||||
|
const DATETIME_SPACING_HEIGHT = 5;
|
||||||
const DATE_HEIGHT = 10;
|
const DATE_HEIGHT = 10;
|
||||||
const TIME_HEIGHT = 10;
|
const TIME_HEIGHT = 10;
|
||||||
|
|
||||||
|
@ -26,6 +27,7 @@ const settings = Object.assign(
|
||||||
);
|
);
|
||||||
|
|
||||||
const maxFontSize = SCREEN_HEIGHT
|
const maxFontSize = SCREEN_HEIGHT
|
||||||
|
- TOP_SPACING
|
||||||
- (settings.showWidgets ? WIDGETS_HEIGHT : 0)
|
- (settings.showWidgets ? WIDGETS_HEIGHT : 0)
|
||||||
- (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT : 0)
|
- (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT : 0)
|
||||||
- (settings.showDate ? DATE_HEIGHT : 0)
|
- (settings.showDate ? DATE_HEIGHT : 0)
|
||||||
|
@ -33,6 +35,7 @@ const maxFontSize = SCREEN_HEIGHT
|
||||||
|
|
||||||
const X = SCREEN_WIDTH / 2;
|
const X = SCREEN_WIDTH / 2;
|
||||||
const Y = SCREEN_HEIGHT / 2
|
const Y = SCREEN_HEIGHT / 2
|
||||||
|
+ TOP_SPACING / 2
|
||||||
+ (settings.showWidgets ? WIDGETS_HEIGHT / 2 : 0)
|
+ (settings.showWidgets ? WIDGETS_HEIGHT / 2 : 0)
|
||||||
- (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT / 2 : 0)
|
- (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT / 2 : 0)
|
||||||
- (settings.showDate ? DATE_HEIGHT / 2 : 0)
|
- (settings.showDate ? DATE_HEIGHT / 2 : 0)
|
||||||
|
@ -121,11 +124,11 @@ function setFont(timeLines) {
|
||||||
function getBottomLines() {
|
function getBottomLines() {
|
||||||
const lines = [];
|
const lines = [];
|
||||||
|
|
||||||
if (settings.showTimeLine) {
|
if (settings.showTime) {
|
||||||
lines.push(require("locale").time(date));
|
lines.push(require("locale").time(date));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.showDateLine) {
|
if (settings.showDate) {
|
||||||
lines.push(`${date.getHours()}:${String(date.getMinutes()).padStart(2, '0')}`);
|
lines.push(`${date.getHours()}:${String(date.getMinutes()).padStart(2, '0')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Dutch Clock",
|
"name": "Dutch Clock",
|
||||||
"shortName":"Dutch Clock",
|
"shortName":"Dutch Clock",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.07",
|
"version":"0.08",
|
||||||
"description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.",
|
"description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock,dutch,text",
|
"tags": "clock,dutch,text",
|
||||||
|
|
Loading…
Reference in New Issue