You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
View.draw(): draw background, content, children in same order as AOSP
This commit is contained in:
@@ -94,16 +94,6 @@ void wrapper_widget_allocate(GtkWidget *widget, int width, int height, int basel
|
||||
gtk_widget_size_allocate(wrapper->background, &allocation, baseline);
|
||||
}
|
||||
|
||||
void wrapper_widget_draw_children(WrapperWidget *wrapper, GdkSnapshot *snapshot)
|
||||
{
|
||||
GtkWidget *widget = &wrapper->parent_instance;
|
||||
GtkWidget *child = gtk_widget_get_first_child(widget);
|
||||
while (child) {
|
||||
gtk_widget_snapshot_child(widget, child, snapshot);
|
||||
child = gtk_widget_get_next_sibling(child);
|
||||
}
|
||||
}
|
||||
|
||||
static void wrapper_widget_snapshot(GtkWidget *widget, GdkSnapshot *snapshot)
|
||||
{
|
||||
WrapperWidget *wrapper = WRAPPER_WIDGET(widget);
|
||||
@@ -117,7 +107,12 @@ static void wrapper_widget_snapshot(GtkWidget *widget, GdkSnapshot *snapshot)
|
||||
if ((*env)->ExceptionCheck(env))
|
||||
(*env)->ExceptionDescribe(env);
|
||||
} else {
|
||||
wrapper_widget_draw_children(wrapper, snapshot);
|
||||
GtkWidget *widget = &wrapper->parent_instance;
|
||||
GtkWidget *child = gtk_widget_get_first_child(widget);
|
||||
while (child) {
|
||||
gtk_widget_snapshot_child(widget, child, snapshot);
|
||||
child = gtk_widget_get_next_sibling(child);
|
||||
}
|
||||
}
|
||||
if (wrapper->real_height > 0 && wrapper->real_width > 0) {
|
||||
gtk_snapshot_pop(snapshot);
|
||||
|
||||
Reference in New Issue
Block a user