mirror of
https://github.com/alinanorakari/Pebble-Time-Watchface-Super-Simple.git
synced 2025-12-14 15:45:22 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 18223442d0 | |||
| 9d7b3a945a |
@@ -25,7 +25,7 @@
|
|||||||
"chalk"
|
"chalk"
|
||||||
],
|
],
|
||||||
"uuid": "ceeae81b-6b50-43b6-8bbb-6d6f6eb62b69",
|
"uuid": "ceeae81b-6b50-43b6-8bbb-6d6f6eb62b69",
|
||||||
"versionLabel": "1.5",
|
"versionLabel": "1.6",
|
||||||
"watchapp": {
|
"watchapp": {
|
||||||
"watchface": true
|
"watchface": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ Pebble.addEventListener('webviewclosed', function(e) {
|
|||||||
colorm: parseInt(configData.colorm, 16),
|
colorm: parseInt(configData.colorm, 16),
|
||||||
colorh: parseInt(configData.colorh, 16),
|
colorh: parseInt(configData.colorh, 16),
|
||||||
colorp: parseInt(configData.colorp, 16),
|
colorp: parseInt(configData.colorp, 16),
|
||||||
shadows: configData.shadows === 'true',
|
shadows: 0+(configData.shadows === 'true'),
|
||||||
ticks: configData.ticks,
|
ticks: configData.ticks,
|
||||||
colort: parseInt(configData.colort, 16),
|
colort: parseInt(configData.colort, 16),
|
||||||
rectticks: configData.rectticks === 'true'
|
rectticks: 0+(configData.rectticks === 'true')
|
||||||
}, function() {
|
}, function() {
|
||||||
console.log('Send successful!');
|
console.log('Send successful!');
|
||||||
}, function() {
|
}, function() {
|
||||||
|
|||||||
32
src/main.c
32
src/main.c
@@ -87,7 +87,7 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
|||||||
persist_write_int(KEY_PEG_COLOR, colorp);
|
persist_write_int(KEY_PEG_COLOR, colorp);
|
||||||
gcolorp = GColorFromHEX(colorp);
|
gcolorp = GColorFromHEX(colorp);
|
||||||
}
|
}
|
||||||
if(shadows_t && shadows_t->value->int32 > 0) {
|
if(shadows_t && shadows_t->value->int8 > 0) {
|
||||||
persist_write_bool(KEY_SHADOWS, true);
|
persist_write_bool(KEY_SHADOWS, true);
|
||||||
shadows = true;
|
shadows = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -103,7 +103,7 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
|||||||
persist_write_int(KEY_TICK_COLOR, colort);
|
persist_write_int(KEY_TICK_COLOR, colort);
|
||||||
gcolort = GColorFromHEX(colort);
|
gcolort = GColorFromHEX(colort);
|
||||||
}
|
}
|
||||||
if(rectticks_t && rectticks_t->value->int32 > 0) {
|
if(rectticks_t && rectticks_t->value->int8 > 0) {
|
||||||
persist_write_bool(KEY_RECT_TICKS, true);
|
persist_write_bool(KEY_RECT_TICKS, true);
|
||||||
rectticks = true;
|
rectticks = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -220,24 +220,26 @@ static void update_proc(Layer *layer, GContext *ctx) {
|
|||||||
#if defined(PBL_RECT)
|
#if defined(PBL_RECT)
|
||||||
if (rectticks) {
|
if (rectticks) {
|
||||||
int dist_v = 41;
|
int dist_v = 41;
|
||||||
int dist_h = 44;
|
int dist_h = 46;
|
||||||
|
int halfwidth = (bounds.size.w/2)-1;
|
||||||
|
int halfheight = (bounds.size.h/2)-1;
|
||||||
switch (ticks) {
|
switch (ticks) {
|
||||||
case 12:
|
case 12:
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w/2)+dist_h, 4), TICK_RADIUS/2); // 1
|
graphics_fill_circle(ctx, GPoint(halfwidth+dist_h, 4), TICK_RADIUS/2); // 1
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w/2)-dist_h, 4), TICK_RADIUS/2); // 11
|
graphics_fill_circle(ctx, GPoint(halfwidth-dist_h, 4), TICK_RADIUS/2); // 11
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w/2)+dist_h, (bounds.size.h-5)), TICK_RADIUS/2); // 5
|
graphics_fill_circle(ctx, GPoint(halfwidth+dist_h, (bounds.size.h-5)), TICK_RADIUS/2); // 5
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w/2)-dist_h, (bounds.size.h-5)), TICK_RADIUS/2); // 7
|
graphics_fill_circle(ctx, GPoint(halfwidth-dist_h, (bounds.size.h-5)), TICK_RADIUS/2); // 7
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w-5), (bounds.size.h/2)-dist_v), TICK_RADIUS/2); // 2
|
graphics_fill_circle(ctx, GPoint((bounds.size.w-5), halfheight-dist_v), TICK_RADIUS/2); // 2
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w-5), (bounds.size.h/2)+dist_v), TICK_RADIUS/2); // 4
|
graphics_fill_circle(ctx, GPoint((bounds.size.w-5), halfheight+dist_v), TICK_RADIUS/2); // 4
|
||||||
graphics_fill_circle(ctx, GPoint(4, (bounds.size.h/2)-dist_v), TICK_RADIUS/2); // 10
|
graphics_fill_circle(ctx, GPoint(4, halfheight-dist_v), TICK_RADIUS/2); // 10
|
||||||
graphics_fill_circle(ctx, GPoint(4, (bounds.size.h/2)+dist_v), TICK_RADIUS/2); // 8
|
graphics_fill_circle(ctx, GPoint(4, halfheight+dist_v), TICK_RADIUS/2); // 8
|
||||||
case 4:
|
case 4:
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w/2), (bounds.size.h-3)), TICK_RADIUS); // 6
|
graphics_fill_circle(ctx, GPoint(halfwidth, (bounds.size.h-3)), TICK_RADIUS); // 6
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w-3), (bounds.size.h/2)), TICK_RADIUS); // 3
|
graphics_fill_circle(ctx, GPoint((bounds.size.w-3), halfheight), TICK_RADIUS); // 3
|
||||||
graphics_fill_circle(ctx, GPoint(2, (bounds.size.h/2)), TICK_RADIUS); // 9
|
graphics_fill_circle(ctx, GPoint(2, halfheight), TICK_RADIUS); // 9
|
||||||
case 1:
|
case 1:
|
||||||
default:
|
default:
|
||||||
graphics_fill_circle(ctx, GPoint((bounds.size.w/2), 2), TICK_RADIUS); // 12
|
graphics_fill_circle(ctx, GPoint(halfwidth, 2), TICK_RADIUS); // 12
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user