More alignment fixes
This commit is contained in:
15
src/c/main.c
15
src/c/main.c
@@ -3,7 +3,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
// #define DEBUG_MODE 1
|
||||
#define DEBUG_MODE 1
|
||||
|
||||
// declare settings-derived statics
|
||||
static uint8_t s_is_jellyfin;
|
||||
@@ -21,6 +21,7 @@ static Layer *s_sleep_icon_layer;
|
||||
static Layer *s_pin_icon_layer;
|
||||
static GDrawCommandImage *s_sleep_icon;
|
||||
static GDrawCommandImage *s_pin_icon;
|
||||
static const uint8_t s_icon_width = 25;
|
||||
#if PBL_ROUND
|
||||
#if PBL_DISPLAY_WIDTH >= 200
|
||||
static const uint8_t s_sleep_bar_drop = 53;
|
||||
@@ -33,7 +34,7 @@ static const uint8_t s_sleep_bar_drop = 31;
|
||||
|
||||
// declare animation statics
|
||||
static GRect s_sleep_bar_start = GRect(0, 0, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT);
|
||||
static GRect s_sleep_icon_start = GRect((PBL_DISPLAY_WIDTH / 2) - 13, (PBL_DISPLAY_HEIGHT / 2) - 12, 25, 25);
|
||||
static GRect s_sleep_icon_start = GRect((PBL_DISPLAY_WIDTH / 2) - 13, (PBL_DISPLAY_HEIGHT / 2) - 12, s_icon_width, s_icon_width);
|
||||
|
||||
// declare time tracking statics
|
||||
static time_t s_sleep_timestamp;
|
||||
@@ -111,12 +112,12 @@ static void main_window_load(Window *window) {
|
||||
layer_set_update_proc(s_sleep_icon_layer, sleep_icon_update_proc);
|
||||
|
||||
// pin icon
|
||||
s_pin_icon_layer = layer_create(GRect(PBL_DISPLAY_WIDTH - PBL_IF_ROUND_ELSE(27, 25), (PBL_DISPLAY_HEIGHT / 2) - 13, 25, 25));
|
||||
s_pin_icon_layer = layer_create(GRect(PBL_DISPLAY_WIDTH - PBL_IF_ROUND_ELSE(s_icon_width + 3, s_icon_width), (PBL_DISPLAY_HEIGHT / 2) - 13, s_icon_width, s_icon_width));
|
||||
layer_set_update_proc(s_pin_icon_layer, pin_icon_update_proc);
|
||||
pin_animation_init(s_pin_icon_layer);
|
||||
|
||||
uint8_t margin = PBL_DISPLAY_WIDTH / 35;
|
||||
s_last_watched_layer = text_layer_create(GRect(PBL_IF_ROUND_ELSE(28, margin), s_sleep_bar_drop + margin, PBL_DISPLAY_WIDTH - PBL_IF_ROUND_ELSE(56, 29), PBL_DISPLAY_HEIGHT));
|
||||
uint8_t rect_side_margin = PBL_DISPLAY_WIDTH / 35;
|
||||
s_last_watched_layer = text_layer_create(GRect(PBL_IF_ROUND_ELSE(s_icon_width, 0) + rect_side_margin, s_sleep_bar_drop, PBL_DISPLAY_WIDTH - (PBL_IF_ROUND_ELSE(s_icon_width * 2, s_icon_width) + rect_side_margin * 2), PBL_DISPLAY_HEIGHT - s_sleep_bar_drop));
|
||||
#if PBL_DISPLAY_WIDTH >= 200
|
||||
s_sleep_time_layer = text_layer_create(GRect(0, PBL_IF_ROUND_ELSE(21, -2), PBL_DISPLAY_WIDTH, 30));
|
||||
text_layer_set_font(s_sleep_time_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
|
||||
@@ -164,7 +165,7 @@ static void main_window_load(Window *window) {
|
||||
// add layers as children to windows
|
||||
#if PBL_RECT
|
||||
// button bar
|
||||
s_button_bar_layer = layer_create(GRect(PBL_DISPLAY_WIDTH - 25, 0, 25, PBL_DISPLAY_HEIGHT));
|
||||
s_button_bar_layer = layer_create(GRect(PBL_DISPLAY_WIDTH - s_icon_width, 0, s_icon_width, PBL_DISPLAY_HEIGHT));
|
||||
layer_set_update_proc(s_button_bar_layer, button_bar_update_proc);
|
||||
layer_add_child(window_layer, s_button_bar_layer);
|
||||
#endif
|
||||
@@ -298,7 +299,7 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
PropertyAnimation *sleep_bar_prop = property_animation_create_layer_frame(s_sleep_bar_layer, &s_sleep_bar_start, &GRect(0, -PBL_DISPLAY_HEIGHT + s_sleep_bar_drop, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT));
|
||||
Animation *sleep_bar_anim = property_animation_get_animation(sleep_bar_prop);
|
||||
animation_set_duration(sleep_bar_anim, 512);
|
||||
PropertyAnimation *sleep_icon_prop = property_animation_create_layer_frame(s_sleep_icon_layer, &s_sleep_icon_start, &GRect(PBL_IF_ROUND_ELSE((PBL_DISPLAY_WIDTH / 2) - 13, 4), 4, 25, 25));
|
||||
PropertyAnimation *sleep_icon_prop = property_animation_create_layer_frame(s_sleep_icon_layer, &s_sleep_icon_start, &GRect(PBL_IF_ROUND_ELSE((PBL_DISPLAY_WIDTH / 2) - 13, 4), 4, s_icon_width, s_icon_width));
|
||||
Animation *sleep_icon_anim = property_animation_get_animation(sleep_icon_prop);
|
||||
animation_set_duration(sleep_icon_anim, 512);
|
||||
Animation *load_spawn_anim = animation_spawn_create(sleep_bar_anim, sleep_icon_anim, NULL);
|
||||
|
||||
Reference in New Issue
Block a user