start implementing Drawable using underlying GdkPaintable

This commit is contained in:
Julian Winkler
2023-12-29 16:55:11 +01:00
parent 1b03fa6e1a
commit 8c7dbf6ceb
11 changed files with 148 additions and 14 deletions

View File

@@ -92,6 +92,8 @@ void wrapper_widget_allocate(GtkWidget *widget, int width, int height, int basel
gtk_widget_size_allocate(wrapper->child, &allocation, baseline);
if (wrapper->sk_area)
gtk_widget_size_allocate(wrapper->sk_area, &allocation, baseline);
if (wrapper->background)
gtk_widget_size_allocate(wrapper->background, &allocation, baseline);
}
static void wrapper_widget_class_init(WrapperWidgetClass *class)
@@ -172,3 +174,12 @@ void wrapper_widget_set_layout_params(WrapperWidget *wrapper, int width, int hei
wrapper->layout_width = width;
wrapper->layout_height = height;
}
void wrapper_widget_set_background(WrapperWidget *wrapper, GdkPaintable *paintable)
{
if (!wrapper->background) {
wrapper->background = gtk_picture_new();
gtk_widget_insert_after(wrapper->background, GTK_WIDGET(wrapper), NULL);
}
gtk_picture_set_paintable(GTK_PICTURE(wrapper->background), paintable);
}