run clang format
This commit is contained in:
@@ -408,14 +408,13 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
focused->signal_cb(focused, LV_SIGNAL_PRESSED, NULL);
|
||||
if(i->proc.reset_query) return; /*The object might be deleted*/
|
||||
lv_event_send(focused, LV_EVENT_PRESSED, NULL);
|
||||
if(i->proc.reset_query) return; /*The object might be deleted*/
|
||||
}
|
||||
else if(data->key == LV_KEY_ESC) {
|
||||
if(i->proc.reset_query) return; /*The object might be deleted*/
|
||||
} else if(data->key == LV_KEY_ESC) {
|
||||
/*Send the ESC as a normal KEY*/
|
||||
lv_group_send_data(g, LV_KEY_ESC);
|
||||
|
||||
lv_event_send(focused, LV_EVENT_CANCEL, NULL);
|
||||
if(i->proc.reset_query) return; /*The object might be deleted*/
|
||||
if(i->proc.reset_query) return; /*The object might be deleted*/
|
||||
}
|
||||
/*Move the focus on NEXT*/
|
||||
else if(data->key == LV_KEY_NEXT) {
|
||||
@@ -1069,11 +1068,12 @@ static void indev_drag(lv_indev_proc_t * state)
|
||||
lv_coord_t prev_par_h = lv_obj_get_height(lv_obj_get_parent(drag_obj));
|
||||
|
||||
/*Get the coordinates of the object and modify them*/
|
||||
lv_coord_t act_x = lv_obj_get_x(drag_obj);
|
||||
lv_coord_t act_y = lv_obj_get_y(drag_obj);
|
||||
lv_coord_t act_x = lv_obj_get_x(drag_obj);
|
||||
lv_coord_t act_y = lv_obj_get_y(drag_obj);
|
||||
|
||||
if(allowed_dirs == LV_DRAG_DIR_ALL)
|
||||
lv_obj_set_pos(drag_obj, act_x + state->types.pointer.vect.x, act_y + state->types.pointer.vect.y);
|
||||
lv_obj_set_pos(drag_obj, act_x + state->types.pointer.vect.x,
|
||||
act_y + state->types.pointer.vect.y);
|
||||
else if(allowed_dirs & LV_DRAG_DIR_HOR)
|
||||
lv_obj_set_x(drag_obj, act_x + state->types.pointer.vect.x);
|
||||
else if(allowed_dirs & LV_DRAG_DIR_VER)
|
||||
@@ -1101,7 +1101,6 @@ static void indev_drag(lv_indev_proc_t * state)
|
||||
new_inv_buf_size - inv_buf_size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1149,11 +1148,11 @@ static void indev_drag_throw(lv_indev_proc_t * proc)
|
||||
lv_coord_t act_y = lv_obj_get_y(drag_obj) + proc->types.pointer.drag_throw_vect.y;
|
||||
|
||||
if(allowed_dirs == LV_DRAG_DIR_ALL)
|
||||
lv_obj_set_pos(drag_obj, act_x, act_y);
|
||||
lv_obj_set_pos(drag_obj, act_x, act_y);
|
||||
else if(allowed_dirs & LV_DRAG_DIR_HOR)
|
||||
lv_obj_set_x(drag_obj, act_x);
|
||||
lv_obj_set_x(drag_obj, act_x);
|
||||
else if(allowed_dirs & LV_DRAG_DIR_VER)
|
||||
lv_obj_set_y(drag_obj, act_y);
|
||||
lv_obj_set_y(drag_obj, act_y);
|
||||
|
||||
lv_area_t coord_new;
|
||||
lv_obj_get_coords(drag_obj, &coord_new);
|
||||
|
||||
@@ -1107,8 +1107,7 @@ void lv_obj_set_drag_dir(lv_obj_t * obj, lv_drag_dir_t drag_dir)
|
||||
{
|
||||
obj->drag_dir = drag_dir;
|
||||
|
||||
if(obj->drag_dir != 0)
|
||||
lv_obj_set_drag(obj, true); /*Drag direction requires drag*/
|
||||
if(obj->drag_dir != 0) lv_obj_set_drag(obj, true); /*Drag direction requires drag*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -170,9 +170,9 @@ typedef struct
|
||||
#endif
|
||||
|
||||
enum {
|
||||
LV_DRAG_DIR_HOR = 0x1,
|
||||
LV_DRAG_DIR_VER = 0x2,
|
||||
LV_DRAG_DIR_ALL = 0x3, /* Should be the bitwise OR of the above */
|
||||
LV_DRAG_DIR_HOR = 0x1,
|
||||
LV_DRAG_DIR_VER = 0x2,
|
||||
LV_DRAG_DIR_ALL = 0x3, /* Should be the bitwise OR of the above */
|
||||
};
|
||||
|
||||
typedef uint8_t lv_drag_dir_t;
|
||||
@@ -195,12 +195,12 @@ typedef struct _lv_obj_t
|
||||
void * group_p; /*Pointer to the group of the object*/
|
||||
#endif
|
||||
/*Attributes and states*/
|
||||
uint8_t click : 1; /*1: Can be pressed by an input device*/
|
||||
uint8_t drag : 1; /*1: Enable the dragging*/
|
||||
uint8_t click : 1; /*1: Can be pressed by an input device*/
|
||||
uint8_t drag : 1; /*1: Enable the dragging*/
|
||||
lv_drag_dir_t drag_dir : 2; /* Which directions the object can be dragged in */
|
||||
uint8_t drag_throw : 1; /*1: Enable throwing with drag*/
|
||||
uint8_t drag_parent : 1; /*1: Parent will be dragged instead*/
|
||||
uint8_t hidden : 1; /*1: Object is hidden*/
|
||||
uint8_t drag_throw : 1; /*1: Enable throwing with drag*/
|
||||
uint8_t drag_parent : 1; /*1: Parent will be dragged instead*/
|
||||
uint8_t hidden : 1; /*1: Object is hidden*/
|
||||
uint8_t top : 1; /*1: If the object or its children is clicked it goes to the foreground*/
|
||||
uint8_t opa_scale_en : 1; /*1: opa_scale is set*/
|
||||
uint8_t parent_event : 1; /*1: Send the object's events to the parent too. */
|
||||
|
||||
@@ -90,13 +90,13 @@ typedef struct _disp_drv_t
|
||||
* number of flushed pixels */
|
||||
void (*monitor_cb)(struct _disp_drv_t * disp_drv, uint32_t time, uint32_t px);
|
||||
|
||||
|
||||
#if LV_USE_GPU
|
||||
/*OPTIONAL: Blend two memories using opacity (GPU only)*/
|
||||
void (*mem_blend_cb)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
|
||||
|
||||
/*OPTIONAL: Fill a memory with a color (GPU only)*/
|
||||
void (*mem_fill_cb)(lv_color_t * dest_buf, const lv_area_t * dest_area, const lv_area_t * fill_area, lv_color_t color);
|
||||
void (*mem_fill_cb)(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
const lv_area_t * fill_area, lv_color_t color);
|
||||
#endif
|
||||
|
||||
#if LV_USE_USER_DATA_SINGLE
|
||||
@@ -110,7 +110,6 @@ typedef struct _disp_drv_t
|
||||
lv_disp_drv_user_data_t monitor_user_data;
|
||||
#endif
|
||||
|
||||
|
||||
} lv_disp_drv_t;
|
||||
|
||||
struct _lv_obj_t;
|
||||
|
||||
@@ -322,8 +322,7 @@ static lv_res_t lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param)
|
||||
lv_btn_set_state(ext->bullet, lv_btn_get_state(cb));
|
||||
} else if(sign == LV_SIGNAL_CONTROL) {
|
||||
char c = *((char *)param);
|
||||
if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN || c == LV_KEY_LEFT ||
|
||||
c == LV_KEY_UP) {
|
||||
if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN || c == LV_KEY_LEFT || c == LV_KEY_UP) {
|
||||
lv_btn_set_state(ext->bullet, lv_btn_get_state(cb));
|
||||
}
|
||||
} else if(sign == LV_SIGNAL_GET_TYPE) {
|
||||
|
||||
@@ -169,7 +169,6 @@ bool lv_kb_get_cursor_manage(const lv_obj_t * kb);
|
||||
*/
|
||||
static inline const char ** lv_btnm_get_map_array(const lv_obj_t * btnm);
|
||||
|
||||
|
||||
/**
|
||||
* Get a style of a keyboard
|
||||
* @param kb pointer to a keyboard object
|
||||
|
||||
@@ -108,8 +108,10 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->tab_cnt = 0;
|
||||
|
||||
/* Set a size which fits into the parent.
|
||||
* Don't use `par` directly because if the tabview is created on a page it is moved to the scrollable so the parent has changed */
|
||||
lv_obj_set_size(new_tabview, lv_obj_get_width_fit(lv_obj_get_parent(new_tabview)), lv_obj_get_height_fit(lv_obj_get_parent(new_tabview)));
|
||||
* Don't use `par` directly because if the tabview is created on a page it is moved to the
|
||||
* scrollable so the parent has changed */
|
||||
lv_obj_set_size(new_tabview, lv_obj_get_width_fit(lv_obj_get_parent(new_tabview)),
|
||||
lv_obj_get_height_fit(lv_obj_get_parent(new_tabview)));
|
||||
|
||||
ext->btns = lv_btnm_create(new_tabview, NULL);
|
||||
lv_obj_set_height(ext->btns, 3 * LV_DPI / 4);
|
||||
|
||||
@@ -72,8 +72,10 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
/*Init the new window object*/
|
||||
if(copy == NULL) {
|
||||
/* Set a size which fits into the parent.
|
||||
* Don't use `par` directly because if the window is created on a page it is moved to the scrollable so the parent has changed */
|
||||
lv_obj_set_size(new_win, lv_obj_get_width_fit(lv_obj_get_parent(new_win)), lv_obj_get_height_fit(lv_obj_get_parent(new_win)));
|
||||
* Don't use `par` directly because if the window is created on a page it is moved to the
|
||||
* scrollable so the parent has changed */
|
||||
lv_obj_set_size(new_win, lv_obj_get_width_fit(lv_obj_get_parent(new_win)),
|
||||
lv_obj_get_height_fit(lv_obj_get_parent(new_win)));
|
||||
|
||||
lv_obj_set_pos(new_win, 0, 0);
|
||||
lv_obj_set_style(new_win, &lv_style_pretty);
|
||||
|
||||
Reference in New Issue
Block a user