mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
improve progress bar
This commit is contained in:
parent
7622b12c2d
commit
d062d569cb
@ -1,4 +1,8 @@
|
||||
# 最新动态
|
||||
|
||||
2023/08/10
|
||||
* 完善progress bar的脏矩形(感谢智明提供补丁)
|
||||
|
||||
2023/08/09
|
||||
* 增加函数bits\_stream\_set/bits\_stream\_get
|
||||
|
||||
|
@ -196,7 +196,7 @@ rect_t progress_circle_calc_line_dirty_rect(widget_t* widget, float_t old_value,
|
||||
} else {
|
||||
rect = rect_init(0, 0, widget->w, widget->h);
|
||||
}
|
||||
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
@ -244,6 +244,8 @@ static ret_t progress_circle_on_paint_self(widget_t* widget, canvas_t* c) {
|
||||
}
|
||||
|
||||
vgcanvas_restore(vg);
|
||||
progress_circle->last_dirty_rect = rect_init(progress_circle->dirty_rect.x, progress_circle->dirty_rect.y, progress_circle->dirty_rect.w, progress_circle->dirty_rect.h);
|
||||
progress_circle->dirty_rect = rect_init(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
color = style_get_color(style, STYLE_ID_TEXT_COLOR, trans);
|
||||
@ -268,7 +270,9 @@ ret_t progress_circle_set_value(widget_t* widget, float_t value) {
|
||||
|
||||
if (widget_dispatch(widget, (event_t*)&evt) != RET_STOP) {
|
||||
rect_t r = progress_circle_calc_line_dirty_rect(widget, old_value, value);
|
||||
widget_invalidate(widget, &r);
|
||||
rect_merge(&progress_circle->dirty_rect, &r);
|
||||
rect_merge(&r, &progress_circle->last_dirty_rect);
|
||||
widget_invalidate_force(widget, &r);
|
||||
|
||||
progress_circle->value = value;
|
||||
evt.e.type = EVT_VALUE_CHANGED;
|
||||
|
@ -126,6 +126,10 @@ typedef struct _progress_circle_t {
|
||||
* 是否显示文本(缺省为TRUE)。
|
||||
*/
|
||||
bool_t show_text;
|
||||
|
||||
/* private */
|
||||
rect_t dirty_rect;
|
||||
rect_t last_dirty_rect;
|
||||
} progress_circle_t;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user