Beispiel #1
0
static void dashes_update_proc(Layer *layer, GContext *ctx) {
  GRect bounds = layer_get_bounds(layer);
  const int line_height = 2;

  // Draw line
  graphics_context_set_fill_color(ctx, data_get_color(AppKeyLineColor));
  graphics_fill_rect(ctx, GRect(0, 0, bounds.size.w, line_height), 0 , GCornerNone);

  // Cut dashes
  const int num_dashes = 9;
  const int dash_width = 18;
  const int dash_gap = 2;
  graphics_context_set_fill_color(ctx, data_get_color(AppKeyBackgroundColor));
  for(int i = 0; i < num_dashes; i++) {
    GRect rect = GRect((5 * dash_gap) + (i * dash_width), 0, dash_gap, line_height);
    graphics_fill_rect(ctx, rect, 0, GCornerNone);
  }
}
Beispiel #2
0
static void bt_handler(bool connected) {
#if defined(PBL_COLOR)
  pge_set_background_color(connected ? data_get_color(ColorBackground) : GColorDarkGray);
#endif

  if(!connected) {
    vibes_double_pulse();
  }
}
Beispiel #3
0
void main_reload_config() {
  // Must be before BT handle overwrites the BG color!
  #if defined(PBL_COLOR)
    pge_set_background_color(data_get_color(ColorBackground));
  #elif defined(PBL_BW)
    pge_set_background_color(GColorBlack);
  #endif

  // If bluetooth alert enabled
  if(data_get_bluetooth_alert()) {
    connection_service_subscribe((ConnectionHandlers) {
      .pebble_app_connection_handler = bt_handler
    });
    bt_handler(connection_service_peek_pebble_app_connection());
  } else {
Beispiel #4
0
static void bt_update_proc(Layer *layer, GContext *ctx) {
  graphics_context_set_fill_color(ctx, data_get_color(AppKeyBackgroundColor));
  graphics_fill_rect(ctx, layer_get_bounds(layer), 0 , GCornerNone);
}