Merge pull request #3950 from RKBoss6/modclk-updates
[Modern Clock] Add settings to change color when clockInfo is focusedmaster
commit
747c3d367e
|
|
@ -2,3 +2,4 @@
|
||||||
0.02: Added text truncation for long ClockInfo strings.
|
0.02: Added text truncation for long ClockInfo strings.
|
||||||
0.03: Added small inline Clock Info next to date
|
0.03: Added small inline Clock Info next to date
|
||||||
0.04: Fix date not clearing
|
0.04: Fix date not clearing
|
||||||
|
0.05: Add settings menu with option for accent color when focusing on clockInfo
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ A beautifully simple, modern clock with three Clock Infos, and a clean UI. Fast-
|
||||||
* Uses rounded rectangles and a bold font for a simple, clean, modern look.
|
* Uses rounded rectangles and a bold font for a simple, clean, modern look.
|
||||||
* Has Fast Loading, for quicker access to launcher.
|
* Has Fast Loading, for quicker access to launcher.
|
||||||
|
|
||||||
|
## Settings
|
||||||
|
### Accent Color
|
||||||
|
- The color clockInfos draw as when focused (tapped or changed).
|
||||||
## Creator
|
## Creator
|
||||||
|
|
||||||
RKBoss6
|
RKBoss6
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Modern Clock",
|
"name": "Modern Clock",
|
||||||
"shortName":"Modern Clk",
|
"shortName":"Modern Clk",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"version":"0.04",
|
"version":"0.05",
|
||||||
"description": "A modern, simple clock, with three ClockInfos and Fast Loading",
|
"description": "A modern, simple clock, with three ClockInfos and Fast Loading",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
"tags": "clock,clkinfo",
|
"tags": "clock,clkinfo",
|
||||||
|
|
@ -15,6 +15,10 @@
|
||||||
"readme":"README.md",
|
"readme":"README.md",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"modclock.app.js","url":"app.js"},
|
{"name":"modclock.app.js","url":"app.js"},
|
||||||
{"name":"modclock.img","url":"app-icon.js","evaluate":true}
|
{"name":"modclock.img","url":"app-icon.js","evaluate":true},
|
||||||
|
{"name":"modclock.settings.js","url":"settings.js"}
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
{"name":"modclock.settings.json"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
(function(back) {
|
||||||
|
const FILE = "modclock.settings.json";
|
||||||
|
|
||||||
|
let settings = Object.assign({
|
||||||
|
color: "#00FF00" // default (green)
|
||||||
|
}, require('Storage').readJSON(FILE, true) || {});
|
||||||
|
|
||||||
|
function save() {
|
||||||
|
require('Storage').writeJSON(FILE, settings);
|
||||||
|
console.log("Saved settings:", settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
const colors = {
|
||||||
|
"Red": "#FF0000",
|
||||||
|
"Green": "#00FF00",
|
||||||
|
"Blue": "#0000FF",
|
||||||
|
"Yellow": "#FFFF00",
|
||||||
|
"Purple": "#FF00FF",
|
||||||
|
"Cyan": "#00FFFF"
|
||||||
|
};
|
||||||
|
|
||||||
|
function showMainMenu(back) {
|
||||||
|
E.showMenu({
|
||||||
|
"" : { title : "Modern Clock" },
|
||||||
|
"< Back" : () => back(),
|
||||||
|
"Accent Color" : () => showColorMenu(back)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function showColorMenu() {
|
||||||
|
const menu = {
|
||||||
|
"" : { title: "Pick Color" },
|
||||||
|
"< Back" : () => showMainMenu(back)
|
||||||
|
};
|
||||||
|
|
||||||
|
for (let name in colors) {
|
||||||
|
(function(n) {
|
||||||
|
menu[n] = () => {
|
||||||
|
settings.color = colors[n];
|
||||||
|
save();
|
||||||
|
showMainMenu(back);
|
||||||
|
};
|
||||||
|
})(name);
|
||||||
|
}
|
||||||
|
E.showMenu(menu);
|
||||||
|
}
|
||||||
|
showMainMenu(back);
|
||||||
|
})
|
||||||
Loading…
Reference in New Issue