minor fixes

This commit is contained in:
Gabor Kiss-Vamosi
2021-02-14 14:56:34 +01:00
parent 95b1bd8409
commit bb08660cb6
105 changed files with 731 additions and 891 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
#if LV_USE_FLEX
/** /**
* A simple row and a column layout with flexbox * A simple row and a column layout with flexbox
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
#if LV_USE_FLEX
/** /**
* Arrange items in rows with wrap and place the items to get even space around them. * Arrange items in rows with wrap and place the items to get even space around them.
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
#if LV_USE_FLEX
/** /**
* Use a built in flex layout and demonstrate flex grow. * Use a built in flex layout and demonstrate flex grow.
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
#if LV_USE_FLEX
/** /**
* Reverse the order of flex items * Reverse the order of flex items
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
#if LV_USE_FLEX
static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v) static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
{ {
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
#if LV_USE_FLEX
/** /**
* RTL base direction changes order of the items. * RTL base direction changes order of the items.
+1 -3
View File
@@ -1,7 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
#if LV_USE_GRID
/** /**
* A simple grid * A simple grid
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
#if LV_USE_GRID
/** /**
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
#if LV_USE_GRID
/** /**
* Demonstrate grid's "free unit" * Demonstrate grid's "free unit"
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
#if LV_USE_GRID
/** /**
* Demonstrate track placement * Demonstrate track placement
+2 -3
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
#if LV_USE_GRID
static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v) static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
{ {
@@ -12,7 +11,7 @@ static void column_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
lv_obj_set_style_pad_column(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v); lv_obj_set_style_pad_column(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
} }
/** /**
* Demonstrate margin in grid * Demonstrate column and row gap
*/ */
void lv_example_grid_5(void) void lv_example_grid_5(void)
{ {
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
#if LV_USE_GRID
/** /**
* Demonstrate RTL direction on grid * Demonstrate RTL direction on grid
+1 -1
View File
@@ -1,6 +1,6 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_ARC #if LV_USE_ARC && LV_BUILD_EXAMPLES
void lv_example_arc_1(void) void lv_example_arc_1(void)
{ {
+2 -1
View File
@@ -1,5 +1,6 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_ARC
#if LV_USE_ARC && LV_BUILD_EXAMPLES
/** /**
* An `lv_task` to call periodically to set the angles of the arc * An `lv_task` to call periodically to set the angles of the arc
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_BAR #if LV_USE_BAR && LV_BUILD_EXAMPLES
void lv_example_bar_1(void) void lv_example_bar_1(void)
{ {
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_BAR #if LV_USE_BAR && LV_BUILD_EXAMPLES
/** /**
* Example of styling the bar * Example of styling the bar
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_BAR #if LV_USE_BAR && LV_BUILD_EXAMPLES
static void set_temp(lv_obj_t * bar, int32_t temp) static void set_temp(lv_obj_t * bar, int32_t temp)
{ {
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_BAR #if LV_USE_BAR && LV_BUILD_EXAMPLES
/** /**
* Bar with stripe pattern and ranged value * Bar with stripe pattern and ranged value
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_BAR #if LV_USE_BAR && LV_BUILD_EXAMPLES
/** /**
* Bar with LTR and RTL base direction * Bar with LTR and RTL base direction
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_BAR #if LV_USE_BAR && LV_BUILD_EXAMPLES
static void event_cb(lv_obj_t * obj, lv_event_t e) static void event_cb(lv_obj_t * obj, lv_event_t e)
{ {
+3 -4
View File
@@ -1,14 +1,13 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_BTN && LV_BUILD_EXAMPLES
#if LV_USE_BTN
static void event_handler(lv_obj_t * obj, lv_event_t event) static void event_handler(lv_obj_t * obj, lv_event_t event)
{ {
if(event == LV_EVENT_CLICKED) { if(event == LV_EVENT_CLICKED) {
printf("Clicked\n"); LV_LOG_USER("Clicked\n");
} }
else if(event == LV_EVENT_VALUE_CHANGED) { else if(event == LV_EVENT_VALUE_CHANGED) {
printf("Toggled\n"); LV_LOG_USER("Toggled\n");
} }
} }
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
#if LV_USE_BTNMATRIX
static void event_handler(lv_obj_t * obj, lv_event_t event) static void event_handler(lv_obj_t * obj, lv_event_t event)
{ {
@@ -8,7 +7,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event)
uint32_t id = lv_btnmatrix_get_active_btn(obj); uint32_t id = lv_btnmatrix_get_active_btn(obj);
const char * txt = lv_btnmatrix_get_btn_text(obj, id); const char * txt = lv_btnmatrix_get_btn_text(obj, id);
printf("%s was pressed\n", txt); LV_LOG_USER("%s was pressed\n", txt);
} }
} }
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
#if LV_USE_BTNMATRIX
void event_cb(lv_obj_t * obj, lv_event_t e) void event_cb(lv_obj_t * obj, lv_event_t e)
@@ -1,7 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
#if LV_USE_BTNMATRIX
static void event_cb(lv_obj_t * obj, lv_event_t e) static void event_cb(lv_obj_t * obj, lv_event_t e)
{ {
@@ -1,14 +1,12 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_CALENDAR && LV_BUILD_EXAMPLES
#if LV_USE_CALENDAR
static void event_handler(lv_obj_t * obj, lv_event_t event) static void event_handler(lv_obj_t * obj, lv_event_t event)
{ {
if(event == LV_EVENT_VALUE_CHANGED) { if(event == LV_EVENT_VALUE_CHANGED) {
lv_calendar_date_t date; lv_calendar_date_t date;
if(lv_calendar_get_pressed_date(obj, &date)) { if(lv_calendar_get_pressed_date(obj, &date)) {
printf("Clicked date: %02d.%02d.%d\n", date.day, date.month, date.year); LV_LOG_USER("Clicked date: %02d.%02d.%d\n", date.day, date.month, date.year);
} }
} }
} }
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_CANVAS #if LV_USE_CANVAS && LV_BUILD_EXAMPLES
#define CANVAS_WIDTH 200 #define CANVAS_WIDTH 200
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_CANVAS #if LV_USE_CANVAS && LV_BUILD_EXAMPLES
#define CANVAS_WIDTH 50 #define CANVAS_WIDTH 50
#define CANVAS_HEIGHT 50 #define CANVAS_HEIGHT 50
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_CHART #if LV_USE_CHART && LV_BUILD_EXAMPLES
void lv_example_chart_1(void) void lv_example_chart_1(void)
{ {
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_CHART #if LV_USE_CHART && LV_DRAW_COMPLEX && LV_BUILD_EXAMPLES
static lv_obj_t * chart1; static lv_obj_t * chart1;
static lv_chart_series_t * ser1; static lv_chart_series_t * ser1;
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_CHART #if LV_USE_CHART && LV_BUILD_EXAMPLES
static void event_cb(lv_obj_t * chart, lv_event_t e) static void event_cb(lv_obj_t * chart, lv_event_t e)
{ {
+2 -2
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_CHART #if LV_USE_CHART && LV_BUILD_EXAMPLES
static void event_cb(lv_obj_t * chart, lv_event_t e) static void event_cb(lv_obj_t * chart, lv_event_t e)
@@ -15,7 +15,7 @@ static void event_cb(lv_obj_t * chart, lv_event_t e)
int32_t id = lv_chart_get_pressed_point(chart); int32_t id = lv_chart_get_pressed_point(chart);
if(id < 0) return; if(id < 0) return;
printf("Selected point %d\n", id); LV_LOG_USER("Selected point %d\n", id);
lv_chart_series_t * ser = lv_chart_get_series_next(chart, NULL); lv_chart_series_t * ser = lv_chart_get_series_next(chart, NULL);
while(ser) { while(ser) {
@@ -1,13 +1,12 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_CHECKBOX && LV_BUILD_EXAMPLES
#if LV_USE_CHECKBOX
static void event_handler(lv_obj_t * obj, lv_event_t event) static void event_handler(lv_obj_t * obj, lv_event_t event)
{ {
if(event == LV_EVENT_VALUE_CHANGED) { if(event == LV_EVENT_VALUE_CHANGED) {
const char * txt = lv_checkbox_get_text(obj); const char * txt = lv_checkbox_get_text(obj);
const char * state = lv_obj_get_state(obj) & LV_STATE_CHECKED ? "Checked" : "Unchecked"; const char * state = lv_obj_get_state(obj) & LV_STATE_CHECKED ? "Checked" : "Unchecked";
printf("%s: %s\n", txt, state); LV_LOG_USER("%s: %s\n", txt, state);
} }
} }
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_COLORWHEEL #if LV_USE_COLORWHEEL && LV_BUILD_EXAMPLES
void lv_example_colorwheel_1(void) void lv_example_colorwheel_1(void)
{ {
@@ -1,14 +1,12 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
#if LV_USE_DROPDOWN
static void event_handler(lv_obj_t * obj, lv_event_t event) static void event_handler(lv_obj_t * obj, lv_event_t event)
{ {
if(event == LV_EVENT_VALUE_CHANGED) { if(event == LV_EVENT_VALUE_CHANGED) {
char buf[32]; char buf[32];
lv_dropdown_get_selected_str(obj, buf, sizeof(buf)); lv_dropdown_get_selected_str(obj, buf, sizeof(buf));
printf("Option: %s\n", buf); LV_LOG_USER("Option: %s\n", buf);
} }
} }
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
#if LV_USE_DROPDOWN
/** /**
@@ -1,7 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
#if LV_USE_DROPDOWN
/** /**
* Create a menu from a drop-down list and show some drop-down list features and styling * Create a menu from a drop-down list and show some drop-down list features and styling
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_IMG #if LV_USE_IMG && LV_BUILD_EXAMPLES
/* Find the image here: https://github.com/lvgl/lv_examples/tree/master/assets */ /* Find the image here: https://github.com/lvgl/lv_examples/tree/master/assets */
LV_IMG_DECLARE(img_cogwheel_argb); LV_IMG_DECLARE(img_cogwheel_argb);
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_IMG #if LV_USE_IMG && LV_BUILD_EXAMPLES
static lv_obj_t * create_slider(lv_color_t color); static lv_obj_t * create_slider(lv_color_t color);
static void slider_event_cb(lv_obj_t * slider, lv_event_t event); static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_IMG #if LV_USE_IMG && LV_BUILD_EXAMPLES
LV_IMG_DECLARE(img_cogwheel_argb); LV_IMG_DECLARE(img_cogwheel_argb);
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_IMG #if LV_USE_IMG && LV_BUILD_EXAMPLES
LV_IMG_DECLARE(img_skew_strip); LV_IMG_DECLARE(img_skew_strip);
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_IMGBTN && LV_BUILD_EXAMPLES
#if LV_USE_IMGBTN
void lv_example_imgbtn_1(void) void lv_example_imgbtn_1(void)
{ {
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_KEYBOARD #if LV_USE_KEYBOARD && LV_BUILD_EXAMPLES
static void ta_event_cb(lv_obj_t * ta, lv_event_t e) static void ta_event_cb(lv_obj_t * ta, lv_event_t e)
{ {
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_LABEL #if LV_USE_LABEL && LV_BUILD_EXAMPLES
/** /**
* Show line wrap, re-color, line align and text scrolling. * Show line wrap, re-color, line align and text scrolling.
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_LABEL #if LV_USE_LABEL && LV_BUILD_EXAMPLES
/** /**
* Create a fake text shadow * Create a fake text shadow
+6 -2
View File
@@ -1,6 +1,9 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_LED #if LV_USE_LED && LV_BUILD_EXAMPLES
/**
* Create LED's with different brightness and color
*/
void lv_example_led_1(void) void lv_example_led_1(void)
{ {
/*Create a LED and switch it OFF*/ /*Create a LED and switch it OFF*/
@@ -11,7 +14,8 @@ void lv_example_led_1(void)
/*Copy the previous LED and set a brightness*/ /*Copy the previous LED and set a brightness*/
lv_obj_t * led2 = lv_led_create(lv_scr_act()); lv_obj_t * led2 = lv_led_create(lv_scr_act());
lv_obj_align(led2, NULL, LV_ALIGN_CENTER, 0, 0); lv_obj_align(led2, NULL, LV_ALIGN_CENTER, 0, 0);
lv_led_set_bright(led2, 150); lv_led_set_brightness(led2, 150);
lv_led_set_color(led2, LV_COLOR_RED);
/*Copy the previous LED and switch it ON*/ /*Copy the previous LED and switch it ON*/
lv_obj_t * led3 = lv_led_create(lv_scr_act()); lv_obj_t * led3 = lv_led_create(lv_scr_act());
+1 -1
View File
@@ -1,5 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#if LV_USE_LINE #if LV_USE_LINE && LV_BUILD_EXAMPLES
void lv_example_line_1(void) void lv_example_line_1(void)
{ {
+2 -3
View File
@@ -1,11 +1,10 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_LIST && LV_BUILD_EXAMPLES
#if LV_USE_LIST
static void event_handler(lv_obj_t * obj, lv_event_t event) static void event_handler(lv_obj_t * obj, lv_event_t event)
{ {
if(event == LV_EVENT_CLICKED) { if(event == LV_EVENT_CLICKED) {
printf("Clicked: %s\n", lv_list_get_btn_text(obj)); LV_LOG_USER("Clicked: %s\n", lv_list_get_btn_text(obj));
} }
} }
void lv_list_example_1(void) void lv_list_example_1(void)
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_METER && LV_BUILD_EXAMPLES
#if LV_USE_METER
static lv_obj_t * meter; static lv_obj_t * meter;
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_METER && LV_BUILD_EXAMPLES
#if LV_USE_METER
static lv_obj_t * meter; static lv_obj_t * meter;
+1 -2
View File
@@ -1,6 +1,5 @@
#include "../../../lvgl.h" #include "../../../lvgl.h"
#include <stdio.h> #if LV_USE_METER && LV_BUILD_EXAMPLES
#if LV_USE_METER
static lv_obj_t * meter; static lv_obj_t * meter;

Some files were not shown because too many files have changed in this diff Show More