improve list view

This commit is contained in:
lixianjing 2024-06-15 22:07:21 +08:00
parent 45395c8ec7
commit 77c2217b9f
3 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,8 @@
# 最新动态
2024/06/15
* 修复list_view的等于虚高也出现滚动条的问题和修改悬浮滚动条不再影响scroll_view的宽度(感谢智明提供补丁)
2024/06/14
* 给widget_visible_in_scroll_view.inc增加注释和修复默认滚动规则的算法(感谢智明提供补丁)
* 修复3key5key页面不能自动聚焦的功能(感谢智明提供补丁)

View File

@ -377,7 +377,9 @@ static int32_t children_layouter_list_view_for_list_view_get_scroll_view_w(list_
widget_t* scroll_bar = NULL;
return_value_if_fail(list_view != NULL && scroll_view != NULL, 0);
scroll_bar = list_view->scroll_bar;
if (list_view->floating_scroll_bar || scroll_bar == NULL || scroll_bar_is_mobile(scroll_bar) ||
if (list_view->floating_scroll_bar) {
scroll_view_w = scroll_view->w;
} else if (scroll_bar == NULL || scroll_bar_is_mobile(scroll_bar) ||
(!scroll_bar_is_mobile(scroll_bar) && list_view->auto_hide_scroll_bar &&
scroll_view->h >= virtual_h)) {
scroll_view_w = list_view->widget.w;
@ -452,7 +454,7 @@ static ret_t children_layouter_list_view_for_list_view_set_scroll_bar_info(widge
} else {
if (scroll_view->h >= virtual_h) {
scroll_bar_set_value(widget, 0);
if (list_view->auto_hide_scroll_bar || list_view->floating_scroll_bar) {
if (list_view->auto_hide_scroll_bar) {
widget_set_sensitive(widget, FALSE);
widget_set_visible_only(widget, FALSE);
} else {

View File

@ -110,7 +110,7 @@ static bool_t list_view_is_play_floating_scroll_bar_animtion(list_view_t* list_v
scroll_view = SCROLL_VIEW(list_view->scroll_view);
return_value_if_fail(scroll_view != NULL, FALSE);
if (list_view->floating_scroll_bar && scroll_view->virtual_h >= list_view->widget.h) {
if (list_view->floating_scroll_bar && scroll_view->virtual_h > list_view->widget.h) {
return TRUE;
}
}