-
Notifications
You must be signed in to change notification settings - Fork 14
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
b5b616c
commit 9a02a0d
Showing
33 changed files
with
744 additions
and
96 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
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,56 @@ | ||
|
||
#include "button_default_gen.h" | ||
#include "ui.h" | ||
|
||
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_main_inited = false; | ||
|
||
if(!style_main_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_main_inited = true; | ||
} | ||
|
||
lv_obj_t * obj = lv_button_create(parent); | ||
|
||
lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);lv_obj_add_style(obj, &style_pr, LV_STATE_PRESSED); | ||
lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
lv_obj_t * h3 = h3_create(obj, "$button_label"); | ||
lv_obj_set_align(h3, LV_ALIGN_CENTER); | ||
|
||
|
||
LV_TRACE_OBJ_CREATE("finished"); | ||
|
||
return obj; | ||
} |
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,11 @@ | ||
|
||
#ifndef BUTTON_DEFAULT_H | ||
#define BUTTON_DEFAULT_H | ||
|
||
#include "lvgl/lvgl.h" | ||
|
||
|
||
|
||
lv_obj_t * button_default_create(lv_obj_t * parent, const char * button_label); | ||
|
||
#endif /*BUTTON_DEFAULT_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
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,56 @@ | ||
|
||
#include "button_error_gen.h" | ||
#include "ui.h" | ||
|
||
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_main_inited = false; | ||
|
||
if(!style_main_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_main_inited = true; | ||
} | ||
|
||
lv_obj_t * obj = lv_button_create(parent); | ||
|
||
lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT);lv_obj_add_style(obj, &style_pr, LV_STATE_PRESSED); | ||
lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
lv_obj_t * h3 = h3_create(obj, "$button_label"); | ||
lv_obj_set_align(h3, LV_ALIGN_CENTER); | ||
|
||
|
||
LV_TRACE_OBJ_CREATE("finished"); | ||
|
||
return obj; | ||
} |
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,11 @@ | ||
|
||
#ifndef BUTTON_ERROR_H | ||
#define BUTTON_ERROR_H | ||
|
||
#include "lvgl/lvgl.h" | ||
|
||
|
||
|
||
lv_obj_t * button_error_create(lv_obj_t * parent, const char * button_label); | ||
|
||
#endif /*BUTTON_ERROR_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
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,58 @@ | ||
|
||
#include "button_warning_gen.h" | ||
#include "ui.h" | ||
|
||
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_main_inited = false; | ||
|
||
if(!style_main_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_main_inited = true; | ||
} | ||
|
||
lv_obj_t * obj = lv_button_create(parent); | ||
|
||
lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT); | ||
lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
lv_obj_t * h3 = h3_create(obj, "$button_label"); | ||
lv_obj_set_align(h3, LV_ALIGN_CENTER); | ||
|
||
|
||
LV_TRACE_OBJ_CREATE("finished"); | ||
|
||
return obj; | ||
} |
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,11 @@ | ||
|
||
#ifndef BUTTON_WARNING_H | ||
#define BUTTON_WARNING_H | ||
|
||
#include "lvgl/lvgl.h" | ||
|
||
|
||
|
||
lv_obj_t * button_warning_create(lv_obj_t * parent, const char * button_label); | ||
|
||
#endif /*BUTTON_WARNING_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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<component> | ||
<api> | ||
<prop name="text" type="string" default="Label"/> | ||
<prop name="heading_text" type="string" default="Label"/> | ||
</api> | ||
|
||
<styles> | ||
<style name="main" text_font="inter_xl"/> | ||
</styles> | ||
|
||
<view extends="lv_label" styles="main" text="$text"> | ||
<view extends="lv_label" styles="main" text="$heading_text"> | ||
</view> | ||
</component> |
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,35 @@ | ||
|
||
#include "h1_gen.h" | ||
#include "ui.h" | ||
|
||
lv_obj_t * h1_create(lv_obj_t * parent, const char * text) | ||
{ | ||
LV_TRACE_OBJ_CREATE("begin"); | ||
|
||
static lv_style_t style_main; | ||
|
||
|
||
|
||
static bool style_main_inited = false; | ||
|
||
if(!style_main_inited) { | ||
|
||
|
||
lv_style_init(&style_main); | ||
lv_style_set_text_font(&style_main, inter_xl); | ||
|
||
|
||
style_main_inited = true; | ||
} | ||
|
||
lv_obj_t * obj = lv_label_create(parent); | ||
|
||
lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT); | ||
lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
lv_label_set_text(obj, "text"); | ||
|
||
|
||
LV_TRACE_OBJ_CREATE("finished"); | ||
|
||
return obj; | ||
} |
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,11 @@ | ||
|
||
#ifndef H1_H | ||
#define H1_H | ||
|
||
#include "lvgl/lvgl.h" | ||
|
||
|
||
|
||
lv_obj_t * h1_create(lv_obj_t * parent, const char * text); | ||
|
||
#endif /*H1_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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<component> | ||
<api> | ||
<prop name="text" type="string" default="Label"/> | ||
<prop name="heading_text" type="string" default="Label"/> | ||
</api> | ||
|
||
<styles> | ||
<style name="main" text_font="inter_md"/> | ||
</styles> | ||
|
||
<view extends="lv_label" styles="main" text="$text"> | ||
<view extends="lv_label" styles="main" text="$heading_text"> | ||
</view> | ||
</component> |
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,35 @@ | ||
|
||
#include "h2_gen.h" | ||
#include "ui.h" | ||
|
||
lv_obj_t * h2_create(lv_obj_t * parent, const char * text) | ||
{ | ||
LV_TRACE_OBJ_CREATE("begin"); | ||
|
||
static lv_style_t style_main; | ||
|
||
|
||
|
||
static bool style_main_inited = false; | ||
|
||
if(!style_main_inited) { | ||
|
||
|
||
lv_style_init(&style_main); | ||
lv_style_set_text_font(&style_main, inter_md); | ||
|
||
|
||
style_main_inited = true; | ||
} | ||
|
||
lv_obj_t * obj = lv_label_create(parent); | ||
|
||
lv_obj_add_style(obj, &style_main, LV_STATE_DEFAULT); | ||
lv_obj_add_style(obj, &style_main, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
lv_label_set_text(obj, "text"); | ||
|
||
|
||
LV_TRACE_OBJ_CREATE("finished"); | ||
|
||
return obj; | ||
} |
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,11 @@ | ||
|
||
#ifndef H2_H | ||
#define H2_H | ||
|
||
#include "lvgl/lvgl.h" | ||
|
||
|
||
|
||
lv_obj_t * h2_create(lv_obj_t * parent, const char * text); | ||
|
||
#endif /*H2_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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<component> | ||
<api> | ||
<prop name="text" type="string" default="Label"/> | ||
<prop name="heading_text" type="string" default="Label"/> | ||
</api> | ||
|
||
<styles> | ||
<style name="main" text_font="inter_sm"/> | ||
</styles> | ||
|
||
<view extends="lv_label" styles="main" text="$text"> | ||
<view extends="lv_label" styles="main" text="$heading_text"> | ||
</view> | ||
</component> |
Oops, something went wrong.