Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"SETTING_RING_SUNSET_COLOR",
"SETTING_SUN_STROKE_COLOR",
"SETTING_SUN_FILL_COLOR",
"SETTING_USE_LARGE_FONTS"
"SETTING_USE_LARGE_FONTS",
"SETTING_SHOW_LEADING_ZERO"
],
"resources": {
"media": [
Expand Down
12 changes: 7 additions & 5 deletions src/c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ static void update_clock() {
strftime(timeText, TIME_STR_LEN, "%I:%M", timeInfo);
}

// now trim leading 0's
if (timeText[0] == '0') {
// shuffle everyone back by 1
for (int i = 0; i < TIME_STR_LEN; i++) {
timeText[i] = timeText[i + 1];
if (!globalSettings.showLeadingZero) {
// now trim leading 0's
if (timeText[0] == '0') {
// shuffle everyone back by 1
for (int i = 0; i < TIME_STR_LEN; i++) {
timeText[i] = timeText[i + 1];
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/c/messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ void inbox_received_callback(DictionaryIterator *iterator, void *context) {
Tuple *sunStrokeColor_tuple = dict_find(iterator, MESSAGE_KEY_SETTING_SUN_STROKE_COLOR);
Tuple *sunFillColor_tuple = dict_find(iterator, MESSAGE_KEY_SETTING_SUN_FILL_COLOR);
Tuple *useLargeFonts_tuple = dict_find(iterator, MESSAGE_KEY_SETTING_USE_LARGE_FONTS);
Tuple *showLeadingZero_tuple = dict_find(iterator, MESSAGE_KEY_SETTING_SHOW_LEADING_ZERO);

if(timeColor_tuple != NULL) {
globalSettings.timeColor = GColorFromHEX(timeColor_tuple->value->int32);
Expand Down Expand Up @@ -119,6 +120,10 @@ void inbox_received_callback(DictionaryIterator *iterator, void *context) {
globalSettings.useLargeFonts = (bool)useLargeFonts_tuple->value->int8;
}

if(showLeadingZero_tuple != NULL) {
globalSettings.showLeadingZero = (bool)showLeadingZero_tuple->value->int8;
}

Settings_saveToStorage();

message_processed_callback();
Expand Down
1 change: 1 addition & 0 deletions src/c/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void Settings_loadFromStorage() {

// metrics
globalSettings.useLargeFonts = false;
globalSettings.showLeadingZero = false;

// globalSettings.widgets[0] = PBL_IF_HEALTH_ELSE(HEALTH, BATTERY_METER);
// globalSettings.widgets[1] = EMPTY;
Expand Down
6 changes: 4 additions & 2 deletions src/c/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ typedef struct {
GColor sunFillColor;

bool useLargeFonts;

bool showLeadingZero;

// // general settings
// uint8_t languageId;
// bool showLeadingZero;
Expand Down Expand Up @@ -128,7 +129,8 @@ typedef struct {
GColor sunFillColor;

uint8_t useLargeFonts:1;

uint8_t showLeadingZero:1;

// other appearance settings
// uint8_t timeShowLeadingZero:1;

Expand Down
5 changes: 5 additions & 0 deletions src/pkjs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@
"type": "toggle",
"messageKey": "SETTING_USE_LARGE_FONTS",
"label": "Use large fonts"
},
{
"type": "toggle",
"messageKey": "SETTING_SHOW_LEADING_ZERO",
"label": "Show leading zero in the 0-9 hour"
}
]
},
Expand Down