Skip to content

Commit 2d855d2

Browse files
authored
Merge pull request #90 from weihsinyeh/screen_update
Fix widgets not updating with parent's widget
2 parents 62cf542 + 56bc784 commit 2d855d2

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

apps/spline.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static twin_dispatch_result_t _apps_spline_update_pos(apps_spline_t *spline,
129129
spline->points[spline->which].y = twin_sfixed_to_fixed(
130130
_twin_matrix_y(&(spline->inverse_transition), x, y));
131131
_twin_widget_queue_paint(&spline->widget);
132+
twin_widget_children_paint((spline->widget).parent);
132133
return TwinDispatchDone;
133134
}
134135

include/twin.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,9 @@ twin_angle_t twin_acos(twin_fixed_t x);
11241124
* widget.c
11251125
*/
11261126

1127+
/* Paint the widget children of the box. */
1128+
void twin_widget_children_paint(twin_box_t *box);
1129+
11271130
twin_widget_t *twin_widget_create(twin_box_t *parent,
11281131
twin_argb32_t background,
11291132
twin_coord_t width,

src/box.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ twin_dispatch_result_t _twin_box_dispatch(twin_widget_t *widget,
163163
case TwinEventConfigure:
164164
return _twin_box_configure(box);
165165
case TwinEventButtonDown:
166+
twin_window_show(widget->window);
166167
box->button_down =
167168
_twin_box_xy_to_widget(box, event->u.pointer.x, event->u.pointer.y);
168169
if (box->button_down && box->button_down->want_focus)

src/widget.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,13 @@ void _twin_widget_bevel(twin_widget_t *widget, twin_fixed_t b, bool down)
200200
}
201201
}
202202

203+
void twin_widget_children_paint(twin_box_t *box)
204+
{
205+
/* Paint the widget children of the box. */
206+
for (twin_widget_t *child = box->children; child; child = child->next)
207+
_twin_widget_queue_paint(child);
208+
}
209+
203210
twin_widget_t *twin_widget_create(twin_box_t *parent,
204211
twin_argb32_t background,
205212
twin_coord_t width,

0 commit comments

Comments
 (0)