Skip to content

Commit

Permalink
improve sync state to children
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Mar 4, 2025
1 parent 8a015fd commit 5e0aacf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

2025/03/04
* 完善 edit_ex(感谢兆坤提供补丁)
* 完善atomic(感谢兆坤提供补丁)
* 完善 atomic(感谢兆坤提供补丁)
* 完善 sync state to children(感谢兆坤提供补丁)

2025/02/28
* 完善 sync state to children(感谢兆坤提供补丁)
Expand Down
4 changes: 2 additions & 2 deletions src/base/widget.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,8 @@ static inline void widget_sync_state_to_children_impl(widget_t* widget,
}

static inline void widget_sync_state_to_children(widget_t* widget, const char* state_for_style) {
if (widget->last_state_for_style == NULL) {
widget->last_state_for_style = (const char*)(widget->state);
if (widget->loading || !widget_is_window_opened(widget)) {
return;
}
if (!tk_str_eq(state_for_style, widget->last_state_for_style)) {
widget_sync_state_to_children_impl(widget, state_for_style);
Expand Down

0 comments on commit 5e0aacf

Please sign in to comment.