diff --git a/GFX/IntuiClock.psd b/GFX/IntuiClock.psd new file mode 100644 index 0000000..3ac2818 Binary files /dev/null and b/GFX/IntuiClock.psd differ diff --git a/GFX/amiclock.idraw b/GFX/amiclock.idraw deleted file mode 100644 index e0cb353..0000000 Binary files a/GFX/amiclock.idraw and /dev/null differ diff --git a/GFX/amiclock_wide.idraw b/GFX/amiclock_wide.idraw deleted file mode 100644 index 40dc443..0000000 Binary files a/GFX/amiclock_wide.idraw and /dev/null differ diff --git a/appinfo.in.json b/appinfo.in.json index 89a3680..bb15dd7 100644 --- a/appinfo.in.json +++ b/appinfo.in.json @@ -3,7 +3,7 @@ "shortName": null, "longName": null, "companyName": null, - "versionLabel": null, + "versionLabel": "1.2", "sdkVersion": "3", "targetPlatforms": ["basalt"], "watchapp": { @@ -13,8 +13,23 @@ "media": [ { "type": "png", - "name": "IMG_BACKGROUND", - "file": "background.png" + "name": "IMG_BKG_CLASSIC_NARROW", + "file": "bkg_classic_narrow.png" + }, + { + "type": "png", + "name": "IMG_BKG_CLASSIC_WIDE", + "file": "bkg_classic_wide.png" + }, + { + "type": "png", + "name": "IMG_BKG_XEN_NARROW", + "file": "bkg_xen_narrow.png" + }, + { + "type": "png", + "name": "IMG_BKG_XEN_WIDE", + "file": "bkg_xen_wide.png" }, { "type": "png", @@ -40,6 +55,7 @@ "KEY_SECONDS_HAND": 0, "KEY_BATTERY_INDICATOR": 1, "KEY_DATE_FORMAT": 2, - "KEY_WIDE_LAYOUT": 3 + "KEY_WIDE_LAYOUT": 3, + "KEY_XEN_STYLE": 4 } } diff --git a/config/index.html b/config/index.html index f970449..4e1e5d5 100644 --- a/config/index.html +++ b/config/index.html @@ -11,20 +11,12 @@
-
Features
+
Time & Date
- - + + +
+
+
@@ -50,13 +60,15 @@ var input_seconds_hand = document.getElementById('input-seconds-hand'), input_battery_indicator = document.getElementById('input-battery-indicator'), input_date_format = document.getElementById('input-date-format'), - input_wide_layout = document.getElementById('input-wide-layout'); + input_wide_layout = document.getElementById('input-wide-layout'), + input_xen_style = document.getElementById('input-xen-style'); var options = { 'seconds_hand': input_seconds_hand.checked, 'battery_indicator': input_battery_indicator.checked, 'date_format': input_date_format.value, - 'wide_layout': input_wide_layout.checked + 'wide_layout': input_wide_layout.checked, + 'xen_style': input_xen_style.checked }; // Save for next launch @@ -64,8 +76,9 @@ localStorage['battery_indicator'] = options['battery_indicator']; localStorage['date_format'] = options['date_format']; localStorage['wide_layout'] = options['wide_layout']; + localStorage['xen_style'] = options['xen_style']; - console.log('Got options: ' + JSON.stringify(options)); + // console.log('Got options: ' + JSON.stringify(options)); return options; } @@ -85,7 +98,7 @@ var button_submit = document.getElementById('button-submit'); button_submit.addEventListener('click', function() { - console.log('Submit'); + // console.log('Submit'); // Set the return URL depending on the runtime environment var return_to = getQueryParam('return_to', 'pebblejs://close#'); @@ -96,7 +109,8 @@ var input_seconds_hand = document.getElementById('input-seconds-hand'), input_battery_indicator = document.getElementById('input-battery-indicator'), input_date_format = document.getElementById('input-date-format'), - input_wide_layout = document.getElementById('input-wide-layout'); + input_wide_layout = document.getElementById('input-wide-layout'), + input_xen_style = document.getElementById('input-xen-style'); if (localStorage['seconds_hand']) { input_seconds_hand.checked = JSON.parse(localStorage['seconds_hand']); @@ -113,6 +127,10 @@ if (localStorage['wide_layout']) { input_wide_layout.checked = JSON.parse(localStorage['wide_layout']); } + + if (localStorage['xen_style']) { + input_xen_style.checked = JSON.parse(localStorage['xen_style']); + } })(); diff --git a/resources/background.png b/resources/background.png deleted file mode 100644 index 95bb76f..0000000 Binary files a/resources/background.png and /dev/null differ diff --git a/resources/bkg_classic_narrow.png b/resources/bkg_classic_narrow.png new file mode 100644 index 0000000..64bbea4 Binary files /dev/null and b/resources/bkg_classic_narrow.png differ diff --git a/resources/bkg_classic_wide.png b/resources/bkg_classic_wide.png new file mode 100644 index 0000000..0f7a2b6 Binary files /dev/null and b/resources/bkg_classic_wide.png differ diff --git a/resources/bkg_xen_narrow.png b/resources/bkg_xen_narrow.png new file mode 100644 index 0000000..10bacee Binary files /dev/null and b/resources/bkg_xen_narrow.png differ diff --git a/resources/bkg_xen_wide.png b/resources/bkg_xen_wide.png new file mode 100644 index 0000000..392df4c Binary files /dev/null and b/resources/bkg_xen_wide.png differ diff --git a/src/intuiclock.c b/src/intuiclock.c index b534b7b..b43cc58 100644 --- a/src/intuiclock.c +++ b/src/intuiclock.c @@ -40,6 +40,7 @@ static bool hide_seconds_hand = false; static bool hide_battery_indicator = false; static char date_format[2]; static bool use_wide_layout = false; +static bool use_xen_style = false; static const GPathInfo MINUTE_HAND_POINTS = { 4, @@ -71,6 +72,7 @@ static const GPathInfo HOUR_HAND_POINTS = { #define KEY_BATTERY_INDICATOR 1 #define KEY_DATE_FORMAT 2 #define KEY_WIDE_LAYOUT 3 +#define KEY_XEN_STYLE 4 static void update_date_text_layer() { static char date_text[DATE_TEXT_SIZE]; @@ -205,17 +207,27 @@ static void update_geometry() { } if (use_wide_layout == false) { - s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMG_BACKGROUND); + if (use_xen_style == false) { + s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMG_BKG_CLASSIC_NARROW); + } else { + s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMG_BKG_XEN_NARROW); + } + layer_set_frame(text_layer_get_layer(s_title_layer), GRect(36, 2, 46, 18)); layer_set_frame(text_layer_get_layer(s_date_layer), GRect(17, 130, 109, 16)); - layer_set_frame(text_layer_get_layer(s_ampm_layer), GRect(107, 26, 16, 16)); + layer_set_frame(text_layer_get_layer(s_ampm_layer), GRect(108, 26, 16, 16)); layer_set_frame(bitmap_layer_get_layer(s_battery_icon_layer), GRect(20, 26, 16, 7)); layer_set_frame(s_battery_indicator_layer, GRect(21, 27, 13, 5)); } else { - s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMG_BACKGROUND_WIDE); + if (use_xen_style == false) { + s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMG_BKG_CLASSIC_WIDE); + } else { + s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMG_BKG_XEN_WIDE); + } + layer_set_frame(text_layer_get_layer(s_title_layer), GRect(24, 2, 71, 18)); layer_set_frame(text_layer_get_layer(s_date_layer), GRect(4, 130, 136, 16)); - layer_set_frame(text_layer_get_layer(s_ampm_layer), GRect(122, 25, 16, 16)); + layer_set_frame(text_layer_get_layer(s_ampm_layer), GRect(123, 25, 16, 16)); layer_set_frame(bitmap_layer_get_layer(s_battery_icon_layer), GRect(7, 26, 16, 7)); layer_set_frame(s_battery_indicator_layer, GRect(8, 27, 13, 5)); } @@ -264,6 +276,18 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) { } persist_write_bool(KEY_WIDE_LAYOUT, use_wide_layout); + + // Handling xen_style setting. + Tuple *xen_style_t = dict_find(iter, KEY_XEN_STYLE); + if (xen_style_t && xen_style_t->value->int32 > 0) { + use_xen_style = true; + } else { + use_xen_style = false; + } + + persist_write_bool(KEY_XEN_STYLE, use_xen_style); + + // Updating geometry according to settings. update_geometry(); } @@ -322,8 +346,9 @@ static void main_window_load(Window *window) { layer_set_update_proc(s_battery_indicator_layer, s_battery_indicator_layer_update); layer_add_child(window_layer, s_battery_indicator_layer); - // Update geometry according to wide_layout setting. + // Update geometry according to wide_layout and xen_style settings. use_wide_layout = persist_read_bool(KEY_WIDE_LAYOUT); + use_xen_style = persist_read_bool(KEY_XEN_STYLE); update_geometry(); // Read date_format setting from persistent storage. diff --git a/src/js/pebble-js-app.js b/src/js/pebble-js-app.js index dabb4a5..6c7a55f 100644 --- a/src/js/pebble-js-app.js +++ b/src/js/pebble-js-app.js @@ -24,19 +24,20 @@ // }); Pebble.addEventListener('showConfiguration', function(e) { - Pebble.openURL('http://127.0.0.1/u/bilbo/pebble/iclock/index.html'); + Pebble.openURL('http://192.168.1.113/u/bilbo/pebble/iclock/index.html'); // Pebble.openURL('https://pconf.bthlabs.pl/intuiclock/index.html'); }); Pebble.addEventListener('webviewclosed', function(e) { var config_data = JSON.parse(decodeURIComponent(e.response)); - // console.log('Configuration page returned: ' + JSON.stringify(config_data)); + console.log('Configuration page returned: ' + JSON.stringify(config_data)); var dict = {}; dict['KEY_SECONDS_HAND'] = config_data['seconds_hand']; dict['KEY_BATTERY_INDICATOR'] = config_data['battery_indicator']; dict['KEY_DATE_FORMAT'] = config_data['date_format']; dict['KEY_WIDE_LAYOUT'] = config_data['wide_layout']; + dict['KEY_XEN_STYLE'] = config_data['xen_style']; Pebble.sendAppMessage(dict, function() { // console.log('Send successful!');