chore: many trivial spelling and layout fixes (#3008)

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
ckielstra
2022-01-17 14:10:23 +01:00
committed by GitHub
parent a9a6cb8efd
commit febafd1cc7
128 changed files with 316 additions and 335 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ def get_icon(filename,xres,yres):
#
img_skew_strip_dsc = get_icon("img_skew_strip",80,20)
style_indic = lv.style_t()
style_indic = lv.style_t()
style_indic.init()
style_indic.set_bg_img_src(img_skew_strip_dsc)
+2 -2
View File
@@ -35,7 +35,7 @@ void lv_example_btn_2(void)
static lv_style_t style_pr;
lv_style_init(&style_pr);
/*Ad a large outline when pressed*/
/*Add a large outline when pressed*/
lv_style_set_outline_width(&style_pr, 30);
lv_style_set_outline_opa(&style_pr, LV_OPA_TRANSP);
@@ -44,7 +44,7 @@ void lv_example_btn_2(void)
lv_style_set_bg_color(&style_pr, lv_palette_darken(LV_PALETTE_BLUE, 2));
lv_style_set_bg_grad_color(&style_pr, lv_palette_darken(LV_PALETTE_BLUE, 4));
/*Add a transition to the the outline*/
/*Add a transition to the outline*/
static lv_style_transition_dsc_t trans;
static lv_style_prop_t props[] = {LV_STYLE_OUTLINE_WIDTH, LV_STYLE_OUTLINE_OPA, 0};
lv_style_transition_dsc_init(&trans, props, lv_anim_path_linear, 300, 0, NULL);
+1 -1
View File
@@ -40,7 +40,7 @@ style_pr.set_shadow_ofs_y(3)
style_pr.set_bg_color(lv.palette_darken(lv.PALETTE.BLUE, 2))
style_pr.set_bg_grad_color(lv.palette_darken(lv.PALETTE.BLUE, 4))
# Add a transition to the the outline
# Add a transition to the outline
trans = lv.style_transition_dsc_t()
props = [lv.STYLE.OUTLINE_WIDTH, lv.STYLE.OUTLINE_OPA, 0]
trans.init(props, lv.anim_t.path_linear, 300, 0, None)
@@ -60,7 +60,7 @@ static void event_cb(lv_event_t * e)
}
/**
* Add custom drawer to the button matrix to customize butons one by one
* Add custom drawer to the button matrix to customize buttons one by one
*/
void lv_example_btnmatrix_2(void)
{
@@ -36,7 +36,7 @@ void lv_example_canvas_1(void)
lv_canvas_draw_text(canvas, 40, 20, 100, &label_dsc, "Some text on text canvas");
/*Test the rotation. It requires an other buffer where the orignal image is stored.
/*Test the rotation. It requires another buffer where the original image is stored.
*So copy the current image to buffer and rotate it to the canvas*/
static lv_color_t cbuf_tmp[CANVAS_WIDTH * CANVAS_HEIGHT];
memcpy(cbuf_tmp, cbuf, sizeof(cbuf_tmp));
@@ -1,5 +1,5 @@
_CANVAS_WIDTH = 200
_CANVAS_HEIGHT = 150
_CANVAS_WIDTH = 200
_CANVAS_HEIGHT = 150
LV_IMG_ZOOM_NONE = 256
rect_dsc = lv.draw_rect_dsc_t()
@@ -30,7 +30,7 @@ canvas.fill_bg(lv.palette_lighten(lv.PALETTE.GREY, 3), lv.OPA.COVER)
canvas.draw_rect(70, 60, 100, 70, rect_dsc)
canvas.draw_text(40, 20, 100, label_dsc, "Some text on text canvas")
# Test the rotation. It requires an other buffer where the original image is stored.
# Test the rotation. It requires another buffer where the original image is stored.
# So copy the current image to buffer and rotate it to the canvas
img = lv.img_dsc_t()
+1 -1
View File
@@ -54,7 +54,7 @@ void lv_example_chart_3(void)
lv_chart_set_next_value(chart, ser1, 22);
lv_chart_set_next_value(chart, ser1, 58);
lv_coord_t * ser2_array = lv_chart_get_y_array(chart, ser2);
lv_coord_t * ser2_array = lv_chart_get_y_array(chart, ser2);
/*Directly set points on 'ser2'*/
ser2_array[0] = 92;
ser2_array[1] = 71;
+2 -2
View File
@@ -46,7 +46,7 @@ chart.set_next_value(ser1, 22)
chart.set_next_value(ser1, 58)
# Directly set points on 'ser2'
ser2.y_points = [92,71,61,15,21,35,35,58,31,53,33,73]
ser2.y_points = [92,71,61,15,21,35,35,58,31,53,33,73]
chart.refresh() #Required after direct set
chart.refresh() # Required after direct set
+2 -2
View File
@@ -39,7 +39,7 @@ static void draw_event_cb(lv_event_t *e)
a.x1 = dsc->p1->x;
a.x2 = dsc->p2->x;
a.y1 = LV_MIN(dsc->p1->y, dsc->p2->y);
a.y2 = obj->coords.y2 - 13; /* -13 cuts off where the rectangle draws over the chart margin. Without this an area of 0 doesnt look like 0 */
a.y2 = obj->coords.y2 - 13; /* -13 cuts off where the rectangle draws over the chart margin. Without this an area of 0 doesn't look like 0 */
lv_draw_rect(dsc->draw_ctx, &draw_rect_dsc, &a);
/*Remove the mask*/
@@ -119,7 +119,7 @@ void lv_example_chart_8(void)
/* Draw to the series in the reverse order to which they were initialised.
Without this the higher values will draw on top of the lower ones.
This is because the Z-height of a series matches the order it was initialsied */
This is because the Z-height of a series matches the order it was initialised */
lv_chart_set_next_value(stacked_area_chart.obj, stacked_area_chart.series_list[3 - series_index - 1], draw_heights[series_index]);
}
}
+2 -2
View File
@@ -40,7 +40,7 @@ def draw_event_cb(e):
a.x1 = dsc.p1.x
a.x2 = dsc.p2.x
a.y1 = min(dsc.p1.y, dsc.p2.y)
a.y2 = cont_a.y2 - 13 # -13 cuts off where the rectangle draws over the chart margin. Without this an area of 0 doesnt look like 0
a.y2 = cont_a.y2 - 13 # -13 cuts off where the rectangle draws over the chart margin. Without this an area of 0 doesn't look like 0
lv.draw_rect(a, dsc.clip_area, draw_rect_dsc)
# Remove the mask
@@ -116,7 +116,7 @@ def lv_example_chart_8():
# Draw to the series in the reverse order to which they were initialised.
# Without this the higher values will draw on top of the lower ones.
# This is because the Z-height of a series matches the order it was initialsied
# This is because the Z-height of a series matches the order it was initialised
stacked_area_chart.obj.set_next_value( stacked_area_chart.series_list[3 - series_index - 1], draw_heights[series_index])
stacked_area_chart.obj.refresh()
@@ -17,7 +17,7 @@ static void radio_event_handler(lv_event_t * e)
if(act_cb == cont) return;
lv_obj_clear_state(old_cb, LV_STATE_CHECKED); /*Uncheck the previous radio button*/
lv_obj_add_state(act_cb, LV_STATE_CHECKED); /*Uncheck the curernt radio button*/
lv_obj_add_state(act_cb, LV_STATE_CHECKED); /*Uncheck the current radio button*/
*active_id = lv_obj_get_index(act_cb);
+1 -1
View File
@@ -23,7 +23,7 @@ void lv_example_meter_3(void)
lv_meter_set_scale_ticks(meter, scale_min, 61, 1, 10, lv_palette_main(LV_PALETTE_GREY));
lv_meter_set_scale_range(meter, scale_min, 0, 60, 360, 270);
/*Create an other scale for the hours. It's only visual and contains only major ticks*/
/*Create another scale for the hours. It's only visual and contains only major ticks*/
lv_meter_scale_t * scale_hour = lv_meter_add_scale(meter);
lv_meter_set_scale_ticks(meter, scale_hour, 12, 0, 0, lv_palette_main(LV_PALETTE_GREY)); /*12 ticks*/
lv_meter_set_scale_major_ticks(meter, scale_hour, 1, 2, 20, lv_color_black(), 10); /*Every tick is major*/
+2 -2
View File
@@ -51,7 +51,7 @@ scale_min = meter.add_scale()
meter.set_scale_ticks(scale_min, 61, 1, 10, lv.palette_main(lv.PALETTE.GREY))
meter.set_scale_range(scale_min, 0, 60, 360, 270)
# Create an other scale for the hours. It's only visual and contains only major ticks
# Create another scale for the hours. It's only visual and contains only major ticks
scale_hour = meter.add_scale()
meter.set_scale_ticks(scale_hour, 12, 0, 0, lv.palette_main(lv.PALETTE.GREY)) # 12 ticks
meter.set_scale_major_ticks(scale_hour, 1, 2, 20, lv.color_black(), 10) # Every tick is major
@@ -59,7 +59,7 @@ meter.set_scale_range(scale_hour, 1, 12, 330, 300) #
# LV_IMG_DECLARE(img_hand)
# Add a the hands from images
# Add the hands from images
indic_min = meter.add_needle_img(scale_min, img_hand_min_dsc, 5, 5)
indic_hour = meter.add_needle_img(scale_min, img_hand_hour_dsc, 5, 5)
@@ -1,5 +1,6 @@
import fs_driver
def event_handler(e):
code = e.get_code()
obj = e.get_target()
@@ -13,7 +14,7 @@ def event_handler(e):
#
# A style to make the selected option larger
style_sel = lv.style_t()
style_sel = lv.style_t()
style_sel.init()
try:
@@ -38,7 +39,7 @@ roller.align(lv.ALIGN.LEFT_MID, 10, 0)
roller.add_event_cb(event_handler, lv.EVENT.ALL, None)
roller.set_selected(2, lv.ANIM.OFF)
# A roller on the middle with center aligned text, and auto (default) width
# A roller in the middle with center aligned text, and auto (default) width
roller = lv.roller(lv.scr_act())
roller.set_options(opts, lv.roller.MODE.NORMAL)
roller.set_visible_row_count(3)
@@ -57,4 +58,3 @@ roller.set_style_text_align(lv.TEXT_ALIGN.RIGHT, 0)
roller.align(lv.ALIGN.RIGHT_MID, -10, 0)
roller.add_event_cb(event_handler, lv.EVENT.ALL, None)
roller.set_selected(8, lv.ANIM.OFF)
@@ -10,7 +10,7 @@ class Lv_Roller_3():
#
# Add a fade mask to roller.
#
style = lv.style_t()
style = lv.style_t()
style.init()
style.set_bg_color(lv.color_black())
style.set_text_color(lv.color_white())
@@ -7,7 +7,7 @@ transition_dsc = lv.style_transition_dsc_t()
transition_dsc.init(props, lv.anim_t.path_linear, 300, 0, None)
style_main = lv.style_t()
style_indicator = lv.style_t()
style_indicator = lv.style_t()
style_knob = lv.style_t()
style_pressed_color = lv.style_t()
style_main.init()
+1 -1
View File
@@ -48,6 +48,6 @@ table.set_cell_value(7, 1, "$9")
table.set_height(200)
table.center()
# Add an event callback to to apply some custom drawing
# Add an event callback to apply some custom drawing
table.add_event_cb(draw_part_event_cb, lv.EVENT.DRAW_PART_BEGIN, None)
+1 -1
View File
@@ -19,7 +19,7 @@ static void draw_event_cb(lv_event_t * e)
lv_area_t sw_area;
sw_area.x1 = dsc->draw_area->x2 - 50;
sw_area.x2 = sw_area.x1 + 40;
sw_area.y1 = dsc->draw_area->y1 + lv_area_get_height(dsc->draw_area) / 2 - 10;
sw_area.y1 = dsc->draw_area->y1 + lv_area_get_height(dsc->draw_area) / 2 - 10;
sw_area.y2 = sw_area.y1 + 20;
lv_draw_rect(dsc->draw_ctx, &rect_dsc, &sw_area);
+1 -1
View File
@@ -80,7 +80,7 @@ for i in range(ITEM_CNT):
table.align(lv.ALIGN.CENTER, 0, -20)
# Add an event callback to to apply some custom drawing
# Add an event callback to apply some custom drawing
table.add_event_cb(draw_event_cb, lv.EVENT.DRAW_PART_END, None)
table.add_event_cb(change_event_cb, lv.EVENT.VALUE_CHANGED, None)
@@ -1,21 +1,22 @@
def textarea_event_handler(e,ta):
def textarea_event_handler(e, ta):
print("Enter was pressed. The current text is: " + ta.get_text())
def btnm_event_handler(e,ta):
def btnm_event_handler(e, ta):
obj = e.get_target()
txt = obj.get_btn_text(obj.get_selected_btn())
if txt == lv.SYMBOL.BACKSPACE:
ta.del_char()
elif txt == lv.SYMBOL.NEW_LINE:
lv.event_send(ta,lv.EVENT.READY,None)
lv.event_send(ta, lv.EVENT.READY, None)
elif txt:
ta.add_text(txt)
ta = lv.textarea(lv.scr_act())
ta.set_one_line(True)
ta.align(lv.ALIGN.TOP_MID, 0, 10)
ta.add_event_cb(lambda e: textarea_event_handler(e,ta), lv.EVENT.READY, None)
ta.add_event_cb(lambda e: textarea_event_handler(e, ta), lv.EVENT.READY, None)
ta.add_state(lv.STATE.FOCUSED) # To be sure the cursor is visible
btnm_map = ["1", "2", "3", "\n",
@@ -26,7 +27,6 @@ btnm_map = ["1", "2", "3", "\n",
btnm = lv.btnmatrix(lv.scr_act())
btnm.set_size(200, 150)
btnm.align(lv.ALIGN.BOTTOM_MID, 0, -10)
btnm.add_event_cb(lambda e: btnm_event_handler(e,ta), lv.EVENT.VALUE_CHANGED, None)
btnm.add_event_cb(lambda e: btnm_event_handler(e, ta), lv.EVENT.VALUE_CHANGED, None)
btnm.clear_flag(lv.obj.FLAG.CLICK_FOCUSABLE) # To keep the text area focused on button clicks
btnm.set_map(btnm_map)
@@ -4,7 +4,7 @@
/**
* Create a 2x2 tile view and allow scrolling only in an "L" shape.
* Demonstrate scroll chaining with a long list that
* scrolls the tile view when it cant't be scrolled further.
* scrolls the tile view when it can't be scrolled further.
*/
void lv_example_tileview_1(void)
{
@@ -29,7 +29,7 @@ void lv_example_tileview_1(void)
lv_obj_center(btn);
/*Tile3: a list*/
lv_obj_t * tile3 = lv_tileview_add_tile(tv, 1, 1, LV_DIR_LEFT);
lv_obj_t * tile3 = lv_tileview_add_tile(tv, 1, 1, LV_DIR_LEFT);
lv_obj_t * list = lv_list_create(tile3);
lv_obj_set_size(list, LV_PCT(100), LV_PCT(100));
@@ -1,7 +1,7 @@
#
# Create a 2x2 tile view and allow scrolling only in an "L" shape.
# Demonstrate scroll chaining with a long list that
# scrolls the tile view when it cant't be scrolled further.
# scrolls the tile view when it can't be scrolled further.
#
tv = lv.tileview(lv.scr_act())
@@ -23,7 +23,7 @@ btn.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT)
btn.center()
# Tile3: a list
tile3 = tv.add_tile(1, 1, lv.DIR.LEFT)
tile3 = tv.add_tile(1, 1, lv.DIR.LEFT)
list = lv.list(tile3)
list.set_size(lv.pct(100), lv.pct(100))
@@ -37,4 +37,3 @@ list.add_btn(None, "Seven")
list.add_btn(None, "Eight")
list.add_btn(None, "Nine")
list.add_btn(None, "Ten")
+2 -2
View File
@@ -23,8 +23,8 @@ void lv_example_win_1(void)
btn = lv_win_add_btn(win, LV_SYMBOL_CLOSE, 60);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
lv_obj_t * cont = lv_win_get_content(win); /*Content can be aded here*/
lv_obj_t * label = lv_label_create(cont);
lv_obj_t * cont = lv_win_get_content(win); /*Content can be added here*/
lv_obj_t * label = lv_label_create(cont);
lv_label_set_text(label, "This is\n"
"a pretty\n"
"long text\n"
+6 -6
View File
@@ -4,17 +4,18 @@ def event_handler(e):
if code == lv.EVENT.CLICKED:
print("Button {:d} clicked".format(obj.get_child_id()))
win = lv.win(lv.scr_act(), 60)
btn1 = win.add_btn(lv.SYMBOL.LEFT, 40)
btn1.add_event_cb(event_handler,lv.EVENT.ALL, None)
btn1.add_event_cb(event_handler, lv.EVENT.ALL, None)
win.add_title("A title")
btn2=win.add_btn(lv.SYMBOL.RIGHT, 40)
btn2.add_event_cb(event_handler,lv.EVENT.ALL, None)
btn2.add_event_cb(event_handler, lv.EVENT.ALL, None)
btn3 = win.add_btn(lv.SYMBOL.CLOSE, 60)
btn3.add_event_cb(event_handler,lv.EVENT.ALL, None)
btn3.add_event_cb(event_handler, lv.EVENT.ALL, None)
cont = win.get_content() #Content can be aded here
label = lv.label(cont)
cont = win.get_content() # Content can be added here
label = lv.label(cont)
label.set_text("""This is
a pretty
long text
@@ -33,4 +34,3 @@ text to be
sure it
overflows.
""")