Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
v6.2 ready
Browse files Browse the repository at this point in the history
Passed beta testing
  • Loading branch information
dieghernan committed Mar 13, 2018
1 parent 11a770a commit c94ccac
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 42 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@
"type": "font"
},
{
"characterRegex": "[0-9 a-z A-Z]",
"file": "fonts/Gotham Light.otf",
"name": "FONT_GLIGHT_12",
"name": "FONT_GLIGHT_10",
"targetPlatforms": null,
"type": "font"
},
Expand All @@ -74,22 +73,23 @@
"type": "font"
},
{
"characterRegex": "[0-9 a-z A-Z]",
"file": "fonts/Gotham Light.otf",
"name": "FONT_GLIGHT_10",
"name": "FONT_GLIGHT_12",
"targetPlatforms": null,
"type": "font"
},
{
"characterRegex": "[0-9:]",
"file": "fonts/Gotham Bold.otf",
"name": "FONT_GBOLD_22",
"name": "FONT_GBOLD_34",
"targetPlatforms": null,
"type": "font"
},
{
"characterRegex": "[0-9:]",
"file": "fonts/Gotham Bold.otf",
"name": "FONT_GBOLD_34",
"name": "FONT_GBOLD_22",
"targetPlatforms": null,
"type": "font"
},
Expand All @@ -111,5 +111,5 @@
"watchface": true
}
},
"version": "6.1.0"
"version": "6.2.0"
}
70 changes: 39 additions & 31 deletions src/c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ static int xdaterect(bool is24, GRect hourect, GRect inner, GRect minrect){
}
else return hourect.origin.x + hourect.size.w + 1;
}
static GRect LineforMin(GRect DotYes,GRect DotNo){
if (settings.DisplayDots){
return DotYes;
}
else {
return DotNo;
}
}
static GColor ColorSelect(GColor ColorDay, GColor ColorNight){
if (settings.NightTheme && settings.IsNightNow ){
return ColorNight;
Expand Down Expand Up @@ -147,7 +139,7 @@ static void layer_update_proc(Layer * layer, GContext * ctx){
graphics_fill_rect(ctx, bounds, 0, GCornersAll);
GRect frame = grect_inset(bounds, GEdgeInsets(7));
GRect inner = grect_inset(frame, GEdgeInsets(12));
GRect inner2 = grect_inset(frame, GEdgeInsets(4));
GRect inner2 = grect_inset(frame, GEdgeInsets(6));
int minute_angle = get_angle_for_minutes(s_minutes);
GRect minrect_init = grect_centered_from_polar(inner, GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE(minute_angle), GSize(36, 28));
GRect minrect = GRect(minrect_init.origin.x + offset,
Expand All @@ -159,7 +151,7 @@ static void layer_update_proc(Layer * layer, GContext * ctx){
0,
GSize(50, 42)
);
GRect hourect_mix = grect_centered_from_polar(GRect(bounds.size.h / 2, bounds.size.w / 2, 0, 0),
GRect mininit_rect = grect_centered_from_polar(GRect(bounds.size.h / 2, bounds.size.w / 2, 0, 0),
GOvalScaleModeFitCircle,
0,
GSize(55, 44)
Expand Down Expand Up @@ -187,7 +179,6 @@ static void layer_update_proc(Layer * layer, GContext * ctx){
// Clock Mode: Analogic - Hour and Minute
else if (settings.ClockMode==2){
GPoint p_center = GPoint(bounds.size.w / 2, bounds.size.h / 2);
GPoint p_minute= gpoint_from_polar(LineforMin(inner, inner2), GOvalScaleModeFitCircle,DEG_TO_TRIGANGLE((s_minutes*360)/60));
//angle hour
int anglehour = (360 * (s_hours % 12) / 12)+(30 * s_minutes / 60);
GPoint p_hour = gpoint_from_polar(grect_inset(inner, GEdgeInsets(25)), GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE(anglehour));
Expand All @@ -202,7 +193,14 @@ static void layer_update_proc(Layer * layer, GContext * ctx){
graphics_context_set_fill_color(ctx,ColorSelect( settings.MinColor, settings.MinColorNight));
graphics_fill_circle(ctx, p_center, 2);
graphics_context_set_stroke_width(ctx, 4);
graphics_draw_line(ctx, p_center, p_minute);
if (settings.DisplayDots){
GPoint p_minute = gpoint_from_polar(inner, GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_draw_line(ctx, p_center, p_minute);
}
else {
GPoint p_minute = gpoint_from_polar(inner2, GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_draw_line(ctx, p_center, p_minute);
}
}
//Dual Mode
else if (settings.ClockMode==3){
Expand All @@ -226,11 +224,16 @@ static void layer_update_proc(Layer * layer, GContext * ctx){
graphics_context_set_stroke_width(ctx, 8);
//Minute
GPoint mininit3=gpoint_from_polar(digmixed, GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
GPoint minfin3= gpoint_from_polar(LineforMin(inner, inner2), GOvalScaleModeFitCircle,DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_context_set_stroke_color(ctx, ColorSelect( settings.MinColor, settings.MinColorNight));
graphics_context_set_stroke_width(ctx, 4);
graphics_draw_line(ctx, mininit3, minfin3);
graphics_context_set_stroke_width(ctx, 3);
if (settings.DisplayDots){
GPoint p_minute = gpoint_from_polar(inner, GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_draw_line(ctx, mininit3, p_minute);
}
else {
GPoint p_minute = gpoint_from_polar(inner2, GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_draw_line(ctx, mininit3, p_minute);
}
//Digital
char hournow3[4];
int hourtorect3 = hourtodraw(clock_is_24h_style(), s_hours);
Expand All @@ -239,23 +242,28 @@ static void layer_update_proc(Layer * layer, GContext * ctx){
char minutenow[4];
snprintf(minutenow, sizeof(minutenow), "%02d", s_minutes);
graphics_draw_text(ctx, minutenow, FontMinute, minmixed, GTextOverflowModeWordWrap, GTextAlignmentCenter, NULL);
}
//Mix Mode
else if (settings.ClockMode==4){
// Minute
GPoint p_min_init=gpoint_from_polar(hourect_mix, GOvalScaleModeFillCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_context_set_stroke_color(ctx, ColorSelect( settings.MinColor, settings.MinColorNight));
graphics_context_set_stroke_width(ctx, 4);
GPoint p_minute= gpoint_from_polar(LineforMin(inner, inner2), GOvalScaleModeFitCircle,DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_draw_line(ctx, p_min_init, p_minute);

// Create hour display
char hournow[4];
int hourtorect = hourtodraw(clock_is_24h_style(), s_hours);
snprintf(hournow, sizeof(hournow), "%02d", hourtorect);
GRect top_hourect =hourect_mix;
graphics_draw_text(ctx, hournow,FontHour,top_hourect,GTextOverflowModeFill, GTextAlignmentCenter, NULL);
}
else if (settings.ClockMode==4){
GRect top_hourect = mininit_rect;
// Minute
GPoint p_min_init=gpoint_from_polar(top_hourect, GOvalScaleModeFillCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_context_set_stroke_color(ctx, ColorSelect( settings.MinColor, settings.MinColorNight));
graphics_context_set_stroke_width(ctx, 4);
if (settings.DisplayDots){
GPoint p_minute = gpoint_from_polar(inner, GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_draw_line(ctx, p_min_init, p_minute);
}
else {
GPoint p_minute = gpoint_from_polar(inner2, GOvalScaleModeFitCircle, DEG_TO_TRIGANGLE((s_minutes*360)/60));
graphics_draw_line(ctx, p_min_init, p_minute);
}

// Create hour display
char hournow[4];
int hourtorect = hourtodraw(clock_is_24h_style(), s_hours);
snprintf(hournow, sizeof(hournow), "%02d", hourtorect);
graphics_draw_text(ctx, hournow,FontHour,top_hourect,GTextOverflowModeFill, GTextAlignmentCenter, NULL);
}
// Complications
int offsetmix;
if (settings.ClockMode==3){
Expand Down
11 changes: 6 additions & 5 deletions src/pkjs/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,17 @@ module.exports = [
},
{
"type": "heading",
"defaultValue": "version v6.1",
"defaultValue":"<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AAYBMD7APLZFN'>Donate via PayPal (0.99€)</a>",
"size":6
},
},
{
"type": "heading",
"defaultValue": "Made in Madrid, Spain",
"defaultValue": "version v6.2",
"size":6
},
{
"type": "text",
"defaultValue":"<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AAYBMD7APLZFN'><img src='data:image/gif;base64,R0lGODlhmAAvAOZ/APCure7arf/KdwBnzXKUtv/v0itOoFOFtM0BAeuPNlS458TN26UFGQEojv/WlgBWov+qJ/y3SezP0M3X5LjS576OjQUGarCYXN7OqKu80Ovu8ydLatbb5bOqmWc5ZnmGhyp8xI6UiqUtRtiaN4CBc+Ln7VBpemGTx7+OPURTWIVxS86ywjBrs+Px+YGr0f++WnGgzr64nWdkUNji7P+yPJ+ARudeXcwuM/P1+PC4bjEDUWMBNEBedhA9aNe1ekyL0//25f+uMrhKUJi43Z6hk4V8YTtFj3NKegNdxA4AYO6gN//PgWB1fzA8cf/syf/z3P/itP7gpv7pwP/57v7nuvzbQP/9+P7mteU2Mv7ksPviRdkKKrXD1vDTQugBKPHz9tnESoWhvpeux5+0y+ddLiOa1mnE7o+pxMOyVozN7a6BRNGGTP7TipvB3l+k1vP6/f/68Y+21c7BnhZkuf3y8vrkzfTn4vXImh4MZZ654a+ddkI7fwAzZv+ZM////////yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlw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6lOALHJBgB74AhK8t4HYPdSvdFPC1V+IAln7IpPj+sIW/3gALQlSCdrcrPTJg4QbV3UJhVToGlHLAvCidwHnVS0sOJHa9h81pItw3h/rWlwUgQMIR9isCBgByeEIYJAPuB7arsmC2rr2tJOvpyAPr9gYQ7ij/hIUgBDKsYQ2Yw7AaTCkIu7nhlRN9JUY1MMtaZoIGXaiCiq/I4hZroQpd6AINMnHSCaxRDIkVAxe4QNkxUvYMO6bsGBTLhZSC8H19M8IejEC4E6ZwtRQAZw5dUAK8grMNVPYDljXZhOv+kHlBHGL0BvgH0TkRik9M8xP/wGIYp1jFcI7zil98xT/MgAMrTeNMl7nMCjKWpmoMNAHUy4H29Q3JJjwhA+y32vw17mz8+7IQh0g9I4rugKTLdOleXAU0fOACXQCDqEWNBjSAwdSlBgOc7cyBme6ZjW3kMwdq+kZl1pTQuksCHd/3gCYLb9HFc/SjIS2CH4ogBWsYYhHJnKzpZmeazVUAwwVO3UAGivoC2J52tlc9TGW28ZmWXcAY3BiGZ0Z2ApYlwBnOOwPdRe0BhxZhAyyAteAxYAf2C7awxZY8SEeOcmiznApksLYymM7Zzob2m928cDerOMYLFyYx42hNikvwmhMcZrsVwTWpVQ1qeLAAHnRA8pBH7ZD7HjbbVr62NBwc4ZqGtpxnTvNVR9DiOM/5BwkRCAA7' /></a>"
"type": "heading",
"defaultValue": "Made in Madrid, Spain",
"size":6
}
];

0 comments on commit c94ccac

Please sign in to comment.