mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
Merge pull request #586 from embeddedt/win_drag
Add `lv_win_set_drag` and `lv_win_get_drag`
This commit is contained in:
commit
097a0c4a90
@ -299,6 +299,18 @@ void lv_win_set_style(lv_obj_t * win, lv_win_style_t type, lv_style_t * style)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set drag status of a window. If set to 'true' window can be dragged like on a PC.
|
||||
* @param win pointer to a window object
|
||||
* @param drag_en whether dragging is enabled
|
||||
*/
|
||||
void lv_win_set_drag(lv_obj_t *win, bool drag_en)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
|
||||
lv_obj_t * win_header = ext->header;
|
||||
lv_obj_set_drag_parent(win_header, drag_en);
|
||||
lv_obj_set_drag(win, drag_en);
|
||||
}
|
||||
|
||||
/*=====================
|
||||
* Getter functions
|
||||
|
@ -157,6 +157,12 @@ void lv_win_set_sb_mode(lv_obj_t *win, lv_sb_mode_t sb_mode);
|
||||
*/
|
||||
void lv_win_set_style(lv_obj_t *win, lv_win_style_t type, lv_style_t *style);
|
||||
|
||||
/**
|
||||
* Set drag status of a window. If set to 'true' window can be dragged like on a PC.
|
||||
* @param win pointer to a window object
|
||||
* @param drag_en whether dragging is enabled
|
||||
*/
|
||||
void lv_win_set_drag(lv_obj_t *win, bool drag_en);
|
||||
|
||||
/*=====================
|
||||
* Getter functions
|
||||
@ -220,6 +226,16 @@ lv_coord_t lv_win_get_width(lv_obj_t * win);
|
||||
*/
|
||||
lv_style_t * lv_win_get_style(const lv_obj_t *win, lv_win_style_t type);
|
||||
|
||||
/**
|
||||
* Get drag status of a window. If set to 'true' window can be dragged like on a PC.
|
||||
* @param win pointer to a window object
|
||||
* @return whether window is draggable
|
||||
*/
|
||||
static inline bool lv_win_get_drag(const lv_obj_t *win)
|
||||
{
|
||||
return lv_obj_get_drag(win);
|
||||
}
|
||||
|
||||
/*=====================
|
||||
* Other functions
|
||||
*====================*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user