Skip to content

Commit 283253e

Browse files
committed
docs: further example fixes
1 parent aca5806 commit 283253e

35 files changed

Lines changed: 1949 additions & 10086 deletions
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
* Size: 28 px
33
* Bpp: 4
4-
* Opts: --font /fonts/Montserrat-Medium.ttf -o /fonts/font_large_data.c --size 28 --bpp 4 --format lvgl --no-compress --range 0x20-0x7F
4+
* Opts: --font /fonts/Montserrat-Medium.ttf -o /fonts/font_large.c --size 28 --bpp 4 --format lvgl --no-compress --range 0x20-0x7F
55
******************************************************************************/
66

77
#ifdef __has_include
@@ -2007,9 +2007,9 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
20072007

20082008
/*Initialize a public general font descriptor*/
20092009
#if LVGL_VERSION_MAJOR >= 8
2010-
const lv_font_t font_large_data = {
2010+
const lv_font_t font_large = {
20112011
#else
2012-
lv_font_t font_large_data = {
2012+
lv_font_t font_large = {
20132013
#endif
20142014
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
20152015
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/

docs/examples/preview-bin/lved-runtime.js

Lines changed: 0 additions & 10016 deletions
This file was deleted.
-3.54 MB
Binary file not shown.

docs/examples/screens/lv_example_button.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ void lv_example_button(void)
4242
lv_obj_t * screen = lv_screen_active();
4343
lv_obj_set_flex_flow(screen, LV_FLEX_FLOW_COLUMN);
4444
lv_obj_set_style_pad_row(screen, 14, 0);
45-
lv_obj_set_style_pad_all(screen, 16, 0);
4645
lv_obj_set_style_flex_cross_place(screen, LV_FLEX_ALIGN_CENTER, 0);
46+
lv_obj_set_style_flex_main_place(screen, LV_FLEX_ALIGN_CENTER, 0);
4747
lv_obj_set_style_flex_track_place(screen, LV_FLEX_ALIGN_CENTER, 0);
4848

4949
/* Plain action button */

docs/examples/screens/lv_example_button.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
<view
2929
flex_flow="column"
3030
style_pad_row="14"
31-
style_pad_all="16"
3231
style_flex_cross_place="center"
32+
style_flex_main_place="center"
3333
style_flex_track_place="center"
3434
>
3535
<!-- 💡 Tap the middle button: it keeps its checked colour until tapped again. -->

docs/examples/screens/lv_example_calendar.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ void lv_example_calendar(void)
3030
}
3131

3232
lv_obj_t * screen = lv_screen_active();
33-
lv_obj_set_style_flex_cross_place(screen, LV_FLEX_ALIGN_CENTER, 0);
34-
lv_obj_set_style_pad_all(screen, 10, 0);
3533

3634
/* 💡 Use the header dropdowns to change month or year. */
3735
lv_obj_t * lv_calendar_0 = lv_calendar_create(screen);
38-
lv_obj_set_size(lv_calendar_0, 260, 210);
36+
lv_obj_set_size(lv_calendar_0, 260, 280);
3937
lv_calendar_set_shown_year(lv_calendar_0, 2026);
4038
lv_calendar_set_shown_month(lv_calendar_0, 5);
39+
lv_obj_set_align(lv_calendar_0, LV_ALIGN_CENTER);
4140
lv_calendar_set_today_year(lv_calendar_0, 2026);
4241
lv_calendar_set_today_month(lv_calendar_0, 5);
4342
lv_calendar_set_today_day(lv_calendar_0, 17);

docs/examples/screens/lv_example_calendar.xml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@
99
-->
1010
<screen>
1111
<styles>
12-
<style name="style_cal"
13-
bg_color="0x0f172a" bg_opa="100%" text_color="0xe2e8f0" radius="8" />
12+
<style name="style_cal" bg_color="0x0f172a" bg_opa="100%" text_color="0xe2e8f0" radius="8" />
1413
</styles>
1514

16-
<view style_flex_cross_place="center" style_pad_all="10">
17-
15+
<view>
1816
<!-- 💡 Use the header dropdowns to change month or year. -->
19-
<lv_calendar width="260" height="210"
20-
shown_year="2026" shown_month="5"
21-
today_year="2026" today_month="5" today_day="17">
17+
<lv_calendar
18+
width="260"
19+
height="280"
20+
shown_year="2026"
21+
shown_month="5"
22+
align="center"
23+
today_year="2026"
24+
today_month="5"
25+
today_day="17"
26+
>
2227
<style name="style_cal" />
2328
<lv_calendar-header_dropdown />
2429
</lv_calendar>

docs/examples/screens/lv_example_chart.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ void lv_example_chart(void)
2727
lv_style_set_radius(&style_chart, 8);
2828
lv_style_set_pad_all(&style_chart, 10);
2929
lv_style_set_line_color(&style_chart, lv_color_hex(0x334155));
30+
lv_style_set_border_width(&style_chart, 0);
3031

3132
lv_style_init(&style_chart_cursor);
3233
lv_style_set_line_dash_gap(&style_chart_cursor, 10);

docs/examples/screens/lv_example_chart.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@
99
-->
1010
<screen>
1111
<styles>
12-
<style name="style_chart" bg_color="0x0f172a" bg_opa="100%" radius="8" pad_all="10" line_color="0x334155" />
12+
<style
13+
name="style_chart"
14+
bg_color="0x0f172a"
15+
bg_opa="100%"
16+
radius="8"
17+
pad_all="10"
18+
line_color="0x334155"
19+
border_width="0"
20+
/>
1321
<style name="style_chart_cursor" line_dash_gap="10" line_dash_width="5" />
1422
</styles>
1523

docs/examples/screens/lv_example_imagebutton.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file lv_example_imagebutton.c
33
*/
44

5-
#include "../lv_examples.h"
5+
#include <examples_ed/lv_examples.h>
66

77
/**
88
* @title Image button
@@ -15,6 +15,10 @@
1515
*/
1616
void lv_example_imagebutton(void)
1717
{
18+
LV_IMAGE_DECLARE(imgbtn_left);
19+
LV_IMAGE_DECLARE(imgbtn_mid);
20+
LV_IMAGE_DECLARE(imgbtn_right);
21+
1822
static lv_style_t style_pressed;
1923

2024
static bool inited = false;
@@ -28,6 +32,19 @@ void lv_example_imagebutton(void)
2832
inited = true;
2933
}
3034

31-
lv_screen_active();
35+
lv_obj_t * screen = lv_screen_active();
36+
37+
lv_obj_t * lv_imagebutton_0 = lv_imagebutton_create(screen);
38+
lv_obj_set_width(lv_imagebutton_0, 160);
39+
lv_obj_set_align(lv_imagebutton_0, LV_ALIGN_CENTER);
40+
lv_obj_add_style(lv_imagebutton_0, &style_pressed, LV_STATE_PRESSED);
41+
lv_imagebutton_set_src_left(lv_imagebutton_0, LV_IMAGEBUTTON_STATE_RELEASED, &imgbtn_left);
42+
lv_imagebutton_set_src_mid(lv_imagebutton_0, LV_IMAGEBUTTON_STATE_RELEASED, &imgbtn_mid);
43+
lv_imagebutton_set_src_right(lv_imagebutton_0, LV_IMAGEBUTTON_STATE_RELEASED, &imgbtn_right);
44+
lv_obj_t * lv_label_0 = lv_label_create(lv_imagebutton_0);
45+
lv_obj_set_align(lv_label_0, LV_ALIGN_CENTER);
46+
lv_label_set_text(lv_label_0, "Press");
47+
lv_obj_set_style_text_color(lv_label_0, lv_color_hex(0xffffff), 0);
48+
lv_obj_set_y(lv_label_0, -3);
3249
}
3350

0 commit comments

Comments
 (0)