/*
 * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: Apache-2.0
 */
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.5.0
// LVGL version: 9.1.0
// Project name: Smart_Gadget

#include "../ui.h"


// COMPONENT Alarm Comp

lv_obj_t *ui_panel_alarm_comp_create(lv_obj_t *comp_parent)
{

    lv_obj_t *cui_panel_alarm_comp;
    cui_panel_alarm_comp = lv_obj_create(comp_parent);
    lv_obj_set_height(cui_panel_alarm_comp, 80);
    lv_obj_set_width(cui_panel_alarm_comp, lv_pct(94));
    lv_obj_set_x(cui_panel_alarm_comp, 0);
    lv_obj_set_y(cui_panel_alarm_comp, 43);
    lv_obj_set_align(cui_panel_alarm_comp, LV_ALIGN_TOP_MID);
    lv_obj_remove_flag(cui_panel_alarm_comp, LV_OBJ_FLAG_SCROLLABLE);      /// Flags
    lv_obj_set_style_bg_color(cui_panel_alarm_comp, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(cui_panel_alarm_comp, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_color(cui_panel_alarm_comp, lv_color_hex(0x293062), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_opa(cui_panel_alarm_comp, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(cui_panel_alarm_comp, 1, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_side(cui_panel_alarm_comp, LV_BORDER_SIDE_BOTTOM, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(cui_panel_alarm_comp, 10, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(cui_panel_alarm_comp, 10, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(cui_panel_alarm_comp, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(cui_panel_alarm_comp, 0, LV_PART_MAIN | LV_STATE_DEFAULT);

    lv_obj_t *cui_label_alarm_num2;
    cui_label_alarm_num2 = lv_label_create(cui_panel_alarm_comp);
    lv_obj_set_width(cui_label_alarm_num2, LV_SIZE_CONTENT);   /// 1
    lv_obj_set_height(cui_label_alarm_num2, LV_SIZE_CONTENT);    /// 1
    lv_obj_set_align(cui_label_alarm_num2, LV_ALIGN_LEFT_MID);
    lv_label_set_text(cui_label_alarm_num2, "7:00");
    lv_obj_set_style_text_color(cui_label_alarm_num2, lv_color_hex(0x293062), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(cui_label_alarm_num2, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(cui_label_alarm_num2, &ui_font_Number, LV_PART_MAIN | LV_STATE_DEFAULT);

    lv_obj_t *cui_small_label_period;
    cui_small_label_period = ui_label_small_label_create(cui_panel_alarm_comp);
    lv_obj_set_x(cui_small_label_period, -5);
    lv_obj_set_y(cui_small_label_period, -6);
    lv_obj_set_align(cui_small_label_period, LV_ALIGN_BOTTOM_RIGHT);
    lv_label_set_text(cui_small_label_period, "Wake Up!");

    lv_obj_t *cui_switch_switch1;
    cui_switch_switch1 = lv_switch_create(cui_panel_alarm_comp);
    lv_obj_set_width(cui_switch_switch1, 61);
    lv_obj_set_height(cui_switch_switch1, 32);
    lv_obj_set_x(cui_switch_switch1, -4);
    lv_obj_set_y(cui_switch_switch1, 11);
    lv_obj_set_align(cui_switch_switch1, LV_ALIGN_TOP_RIGHT);
    lv_obj_set_style_radius(cui_switch_switch1, 50, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(cui_switch_switch1, lv_color_hex(0x9D9ED5), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(cui_switch_switch1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);

    lv_obj_set_style_radius(cui_switch_switch1, 50, LV_PART_INDICATOR | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(cui_switch_switch1, lv_color_hex(0x293062), LV_PART_INDICATOR | LV_STATE_CHECKED);
    lv_obj_set_style_bg_opa(cui_switch_switch1, 255, LV_PART_INDICATOR | LV_STATE_CHECKED);

    lv_obj_set_style_radius(cui_switch_switch1, 50, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(cui_switch_switch1, lv_color_hex(0xFFFFFF), LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(cui_switch_switch1, 255, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(cui_switch_switch1, -3, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(cui_switch_switch1, -3, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(cui_switch_switch1, -3, LV_PART_KNOB | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(cui_switch_switch1, -3, LV_PART_KNOB | LV_STATE_DEFAULT);

    lv_obj_t **children = lv_malloc(sizeof(lv_obj_t *) * _UI_COMP_PANEL_ALARM_COMP_NUM);
    children[UI_COMP_PANEL_ALARM_COMP_PANEL_ALARM_COMP] = cui_panel_alarm_comp;
    children[UI_COMP_PANEL_ALARM_COMP_LABEL_ALARM_NUM2] = cui_label_alarm_num2;
    children[UI_COMP_PANEL_ALARM_COMP_SMALL_LABEL_PERIOD] = cui_small_label_period;
    children[UI_COMP_PANEL_ALARM_COMP_SWITCH_SWITCH1] = cui_switch_switch1;
    lv_obj_add_event_cb(cui_panel_alarm_comp, get_component_child_event_cb, LV_EVENT_GET_COMP_CHILD, children);
    lv_obj_add_event_cb(cui_panel_alarm_comp, del_component_child_event_cb, LV_EVENT_DELETE, children);
    ui_comp_panel_alarm_comp_create_hook(cui_panel_alarm_comp);
    return cui_panel_alarm_comp;
}
