improve demouiold

This commit is contained in:
lixianjing 2024-04-09 18:13:18 +08:00
parent c101edbe1f
commit 62f697943a
2 changed files with 16 additions and 0 deletions

View File

@ -740,6 +740,7 @@ static ret_t on_show_fps(void* ctx, event_t* e) {
widget_invalidate(widget, NULL);
window_manager_set_show_fps(widget, !wm->show_fps);
window_manager_set_show_fps_position(window_manager(), (window_manager()->w - 60) / 2, 0);
widget_set_text(button, wm->show_fps ? L"Hide FPS" : L"Show FPS");
return RET_OK;
@ -1064,6 +1065,18 @@ static ret_t on_click_slide_view_appoint_remove_evt(void* ctx, event_t* e) {
return widget_invalidate(native_window, NULL);
}
static ret_t progress_circle_on_timer(const timer_info_t* timer) {
widget_t* widget = WIDGET(timer->ctx);
uint32_t value = widget_get_prop_int(widget, WIDGET_PROP_VALUE, 0);
if (value >= 128) {
widget_set_style_color(widget, "normal:fg_color", 0xFF0000FF);
} else {
widget_set_style_color(widget, "normal:fg_color", 0xFF000000);
}
return RET_REPEAT;
}
static ret_t install_one(void* ctx, const void* iter) {
widget_t* widget = WIDGET(iter);
widget_t* win = widget_get_window(widget);
@ -1199,6 +1212,8 @@ static ret_t install_one(void* ctx, const void* iter) {
if (tk_str_eq("fruit", (COMBO_BOX(widget))->open_window)) {
combo_box_set_on_item_click(widget, on_combo_box_item_click, widget);
}
} else if (tk_str_eq(widget->vt->type, "progress_circle")) {
widget_add_timer(widget, progress_circle_on_timer, 100);
}
(void)ctx;

View File

@ -3,6 +3,7 @@
2024/04/09
* conf doc extend type\ 支持数组类型(感谢兆坤提供补丁)
* 增加fps的位置直接修改的功能(感谢智明提供补丁)
* 增加demouiold的测试环形进度条的变色例子和增加修改fps位置的例子(感谢智明提供补丁)
2024/04/08
* 执行前根据预解析生成的symbols提前做好locals对象中的占位变量避免出现解析id与局部变量对不上的情况(感谢雨欣提供补丁)