-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af139b4
commit 8c44da0
Showing
36 changed files
with
2,268 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* @file button_default_gen.c | ||
* | ||
* @description Template source file for LVGL objects | ||
* | ||
*/ | ||
|
||
/********************* | ||
* INCLUDES | ||
*********************/ | ||
#include "button_default_gen.h" | ||
#include "ui.h" | ||
|
||
/********************* | ||
* DEFINES | ||
*********************/ | ||
|
||
/********************** | ||
* TYPEDEFS | ||
**********************/ | ||
|
||
/*********************** | ||
* STATIC VARIABLES | ||
**********************/ | ||
|
||
/*********************** | ||
* STATIC PROTOTYPES | ||
**********************/ | ||
|
||
/********************** | ||
* GLOBAL FUNCTIONS | ||
**********************/ | ||
|
||
lv_obj_t * button_default_create(lv_obj_t * parent, const char * button_label) | ||
{ | ||
LV_TRACE_OBJ_CREATE("begin"); | ||
|
||
static lv_style_t style_main; | ||
static lv_style_t style_pr; | ||
|
||
static bool style_inited = false; | ||
|
||
if(!style_inited) { | ||
|
||
lv_style_init(&style_main); | ||
lv_style_set_bg_color(&style_main, lv_color_hex(0x222222)); | ||
lv_style_set_pad_hor(&style_main, 24); | ||
lv_style_set_pad_ver(&style_main, 12); | ||
lv_style_set_border_width(&style_main, 0); | ||
lv_style_set_radius(&style_main, 12); | ||
lv_style_set_shadow_width(&style_main, 0); | ||
|
||
lv_style_init(&style_pr); | ||
lv_style_set_bg_color(&style_pr, lv_color_hex(0x333333)); | ||
lv_style_set_shadow_width(&style_pr, 20); | ||
lv_style_set_shadow_color(&style_pr, lv_color_hex(0x000000)); | ||
lv_style_set_shadow_opa(&style_pr, 40); | ||
|
||
style_inited = true; | ||
} | ||
|
||
lv_obj_t * lv_obj = lv_button_create(parent); | ||
|
||
lv_obj_add_style(lv_obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
lv_obj_add_style(lv_obj, &style_pr, LV_PART_MAIN | LV_STATE_PRESSED); | ||
|
||
lv_obj_t * h3_1 = h3_create(lv_obj, button_label); | ||
lv_obj_set_align(h3_1, LV_ALIGN_CENTER); | ||
|
||
|
||
|
||
LV_TRACE_OBJ_CREATE("finished"); | ||
|
||
return lv_obj; | ||
} | ||
/********************** | ||
* STATIC FUNCTIONS | ||
**********************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @file button_default_gen.h | ||
* | ||
*/ | ||
|
||
#ifndef BUTTON_DEFAULT_H | ||
#define LV_TEMPL_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/********************* | ||
* INCLUDES | ||
*********************/ | ||
#include "lvgl/lvgl.h" | ||
|
||
/********************* | ||
* DEFINES | ||
*********************/ | ||
|
||
/********************** | ||
* TYPEDEFS | ||
**********************/ | ||
|
||
/********************** | ||
* STATIC PROTOTYPES | ||
**********************/ | ||
|
||
/********************** | ||
* GLOBAL PROTOTYPES | ||
**********************/ | ||
|
||
|
||
|
||
lv_obj_t * button_default_create(lv_obj_t * parent, const char * button_label); | ||
/********************** | ||
* MACROS | ||
**********************/ | ||
|
||
#ifdef __cplusplus | ||
} /*extern "C"*/ | ||
#endif | ||
|
||
#endif /*LV_TEMPL_H*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* @file button_error_gen.c | ||
* | ||
* @description Template source file for LVGL objects | ||
* | ||
*/ | ||
|
||
/********************* | ||
* INCLUDES | ||
*********************/ | ||
#include "button_error_gen.h" | ||
#include "ui.h" | ||
|
||
/********************* | ||
* DEFINES | ||
*********************/ | ||
|
||
/********************** | ||
* TYPEDEFS | ||
**********************/ | ||
|
||
/*********************** | ||
* STATIC VARIABLES | ||
**********************/ | ||
|
||
/*********************** | ||
* STATIC PROTOTYPES | ||
**********************/ | ||
|
||
/********************** | ||
* GLOBAL FUNCTIONS | ||
**********************/ | ||
|
||
lv_obj_t * button_error_create(lv_obj_t * parent, const char * button_label) | ||
{ | ||
LV_TRACE_OBJ_CREATE("begin"); | ||
|
||
static lv_style_t style_main; | ||
static lv_style_t style_pr; | ||
|
||
static bool style_inited = false; | ||
|
||
if(!style_inited) { | ||
|
||
lv_style_init(&style_main); | ||
lv_style_set_bg_color(&style_main, lv_color_hex(0xf03c0f)); | ||
lv_style_set_pad_hor(&style_main, 24); | ||
lv_style_set_pad_ver(&style_main, 12); | ||
lv_style_set_border_width(&style_main, 0); | ||
lv_style_set_radius(&style_main, 12); | ||
lv_style_set_shadow_width(&style_main, 0); | ||
|
||
lv_style_init(&style_pr); | ||
lv_style_set_bg_color(&style_pr, lv_color_hex(0xfc5f38)); | ||
lv_style_set_shadow_width(&style_pr, 20); | ||
lv_style_set_shadow_color(&style_pr, lv_color_hex(0x000000)); | ||
lv_style_set_shadow_opa(&style_pr, 40); | ||
|
||
style_inited = true; | ||
} | ||
|
||
lv_obj_t * lv_obj = lv_button_create(parent); | ||
|
||
lv_obj_add_style(lv_obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
lv_obj_add_style(lv_obj, &style_pr, LV_PART_MAIN | LV_STATE_PRESSED); | ||
|
||
lv_obj_t * h3_1 = h3_create(lv_obj, button_label); | ||
lv_obj_set_align(h3_1, LV_ALIGN_CENTER); | ||
|
||
|
||
|
||
LV_TRACE_OBJ_CREATE("finished"); | ||
|
||
return lv_obj; | ||
} | ||
/********************** | ||
* STATIC FUNCTIONS | ||
**********************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @file button_error_gen.h | ||
* | ||
*/ | ||
|
||
#ifndef BUTTON_ERROR_H | ||
#define LV_TEMPL_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/********************* | ||
* INCLUDES | ||
*********************/ | ||
#include "lvgl/lvgl.h" | ||
|
||
/********************* | ||
* DEFINES | ||
*********************/ | ||
|
||
/********************** | ||
* TYPEDEFS | ||
**********************/ | ||
|
||
/********************** | ||
* STATIC PROTOTYPES | ||
**********************/ | ||
|
||
/********************** | ||
* GLOBAL PROTOTYPES | ||
**********************/ | ||
|
||
|
||
|
||
lv_obj_t * button_error_create(lv_obj_t * parent, const char * button_label); | ||
/********************** | ||
* MACROS | ||
**********************/ | ||
|
||
#ifdef __cplusplus | ||
} /*extern "C"*/ | ||
#endif | ||
|
||
#endif /*LV_TEMPL_H*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* @file button_warning_gen.c | ||
* | ||
* @description Template source file for LVGL objects | ||
* | ||
*/ | ||
|
||
/********************* | ||
* INCLUDES | ||
*********************/ | ||
#include "button_warning_gen.h" | ||
#include "ui.h" | ||
|
||
/********************* | ||
* DEFINES | ||
*********************/ | ||
|
||
/********************** | ||
* TYPEDEFS | ||
**********************/ | ||
|
||
/*********************** | ||
* STATIC VARIABLES | ||
**********************/ | ||
|
||
/*********************** | ||
* STATIC PROTOTYPES | ||
**********************/ | ||
|
||
/********************** | ||
* GLOBAL FUNCTIONS | ||
**********************/ | ||
|
||
lv_obj_t * button_warning_create(lv_obj_t * parent, const char * button_label) | ||
{ | ||
LV_TRACE_OBJ_CREATE("begin"); | ||
|
||
static lv_style_t style_main; | ||
static lv_style_t style_pr; | ||
|
||
static bool style_inited = false; | ||
|
||
if(!style_inited) { | ||
|
||
lv_style_init(&style_main); | ||
lv_style_set_bg_color(&style_main, lv_color_hex(0xf0b005)); | ||
lv_style_set_pad_hor(&style_main, 24); | ||
lv_style_set_pad_ver(&style_main, 12); | ||
lv_style_set_border_width(&style_main, 0); | ||
lv_style_set_radius(&style_main, 12); | ||
lv_style_set_shadow_width(&style_main, 0); | ||
lv_style_set_text_color(&style_main, lv_color_hex(0x111111)); | ||
|
||
lv_style_init(&style_pr); | ||
lv_style_set_bg_color(&style_pr, lv_color_hex(0xf9ca4e)); | ||
lv_style_set_shadow_width(&style_pr, 20); | ||
lv_style_set_shadow_color(&style_pr, lv_color_hex(0x000000)); | ||
lv_style_set_shadow_opa(&style_pr, 40); | ||
|
||
style_inited = true; | ||
} | ||
|
||
lv_obj_t * lv_obj = lv_button_create(parent); | ||
|
||
lv_obj_add_style(lv_obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
|
||
lv_obj_t * h3_1 = h3_create(lv_obj, button_label); | ||
lv_obj_set_align(h3_1, LV_ALIGN_CENTER); | ||
|
||
|
||
|
||
LV_TRACE_OBJ_CREATE("finished"); | ||
|
||
return lv_obj; | ||
} | ||
/********************** | ||
* STATIC FUNCTIONS | ||
**********************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @file button_warning_gen.h | ||
* | ||
*/ | ||
|
||
#ifndef BUTTON_WARNING_H | ||
#define LV_TEMPL_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/********************* | ||
* INCLUDES | ||
*********************/ | ||
#include "lvgl/lvgl.h" | ||
|
||
/********************* | ||
* DEFINES | ||
*********************/ | ||
|
||
/********************** | ||
* TYPEDEFS | ||
**********************/ | ||
|
||
/********************** | ||
* STATIC PROTOTYPES | ||
**********************/ | ||
|
||
/********************** | ||
* GLOBAL PROTOTYPES | ||
**********************/ | ||
|
||
|
||
|
||
lv_obj_t * button_warning_create(lv_obj_t * parent, const char * button_label); | ||
/********************** | ||
* MACROS | ||
**********************/ | ||
|
||
#ifdef __cplusplus | ||
} /*extern "C"*/ | ||
#endif | ||
|
||
#endif /*LV_TEMPL_H*/ |
Oops, something went wrong.