lv_win: revert the delete of page (content) specific API function
This commit is contained in:
@@ -229,6 +229,28 @@ void lv_win_set_btn_size(lv_obj_t * win, lv_coord_t size)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the layout of the window
|
||||
* @param win pointer to a window object
|
||||
* @param layout the layout from 'lv_layout_t'
|
||||
*/
|
||||
void lv_win_set_layout(lv_obj_t *win, lv_layout_t layout)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
|
||||
lv_page_set_scrl_layout(ext->page, layout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the scroll bar mode of a window
|
||||
* @param win pointer to a window object
|
||||
* @param sb_mode the new scroll bar mode from 'lv_sb_mode_t'
|
||||
*/
|
||||
void lv_win_set_sb_mode(lv_obj_t *win, lv_sb_mode_t sb_mode)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
|
||||
lv_page_set_sb_mode(ext->page, sb_mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a style of a window
|
||||
* @param win pointer to a window object
|
||||
@@ -276,7 +298,6 @@ void lv_win_set_style(lv_obj_t * win, lv_win_style_t type, lv_style_t * style)
|
||||
btn = lv_obj_get_child_back(ext->header, btn);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -331,6 +352,42 @@ lv_obj_t * lv_win_get_from_btn(const lv_obj_t * ctrl_btn)
|
||||
return win;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the layout of a window
|
||||
* @param win pointer to a window object
|
||||
* @return the layout of the window (from 'lv_layout_t')
|
||||
*/
|
||||
lv_layout_t lv_win_get_layout(lv_obj_t *win)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
|
||||
return lv_page_get_scrl_layout(ext->page);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the scroll bar mode of a window
|
||||
* @param win pointer to a window object
|
||||
* @return the scroll bar mode of the window (from 'lv_sb_mode_t')
|
||||
*/
|
||||
lv_sb_mode_t lv_win_get_sb_mode(lv_obj_t *win)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
|
||||
return lv_page_get_sb_mode(ext->page);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get width of the content area (page scrollable) of the window
|
||||
* @param win pointer to a window object
|
||||
* @return the width of the content_bg area
|
||||
*/
|
||||
lv_coord_t lv_win_get_width(lv_obj_t * win)
|
||||
{
|
||||
lv_win_ext_t * ext = lv_obj_get_ext_attr(win);
|
||||
lv_obj_t * scrl = lv_page_get_scrl(ext->page);
|
||||
lv_style_t * style_scrl = lv_obj_get_style(scrl);
|
||||
|
||||
return lv_obj_get_width(scrl) - 2 * style_scrl->body.padding.hor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a style of a window
|
||||
* @param win pointer to a button object
|
||||
|
||||
@@ -190,6 +190,27 @@ lv_coord_t lv_win_get_btn_size(const lv_obj_t * win);
|
||||
*/
|
||||
lv_obj_t * lv_win_get_from_btn(const lv_obj_t * ctrl_btn);
|
||||
|
||||
/**
|
||||
* Get the layout of a window
|
||||
* @param win pointer to a window object
|
||||
* @return the layout of the window (from 'lv_layout_t')
|
||||
*/
|
||||
lv_layout_t lv_win_get_layout(lv_obj_t *win);
|
||||
|
||||
/**
|
||||
* Get the scroll bar mode of a window
|
||||
* @param win pointer to a window object
|
||||
* @return the scroll bar mode of the window (from 'lv_sb_mode_t')
|
||||
*/
|
||||
lv_sb_mode_t lv_win_get_sb_mode(lv_obj_t *win);
|
||||
|
||||
/**
|
||||
* Get width of the content area (page scrollable) of the window
|
||||
* @param win pointer to a window object
|
||||
* @return the width of the content area
|
||||
*/
|
||||
lv_coord_t lv_win_get_width(lv_obj_t * win);
|
||||
|
||||
/**
|
||||
* Get a style of a window
|
||||
* @param win pointer to a button object
|
||||
|
||||
Reference in New Issue
Block a user