mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-17 23:50:16 +00:00
toolpalette: Port to draw vfunc
This commit is contained in:
parent
f525837e39
commit
a18ec3485c
@ -616,13 +616,12 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gtk_tool_palette_expose_event (GtkWidget *widget,
|
gtk_tool_palette_draw (GtkWidget *widget,
|
||||||
GdkEventExpose *event)
|
cairo_t *cr)
|
||||||
{
|
{
|
||||||
GtkToolPalette *palette = GTK_TOOL_PALETTE (widget);
|
GtkToolPalette *palette = GTK_TOOL_PALETTE (widget);
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
cairo_t *cr;
|
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
window = gtk_widget_get_window (widget);
|
window = gtk_widget_get_window (widget);
|
||||||
@ -632,10 +631,6 @@ gtk_tool_palette_expose_event (GtkWidget *widget,
|
|||||||
if (!gdk_display_supports_composite (display))
|
if (!gdk_display_supports_composite (display))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
cr = gdk_cairo_create (window);
|
|
||||||
gdk_cairo_region (cr, event->region);
|
|
||||||
cairo_clip (cr);
|
|
||||||
|
|
||||||
cairo_push_group (cr);
|
cairo_push_group (cr);
|
||||||
|
|
||||||
for (i = 0; i < palette->priv->groups->len; ++i)
|
for (i = 0; i < palette->priv->groups->len; ++i)
|
||||||
@ -648,7 +643,6 @@ gtk_tool_palette_expose_event (GtkWidget *widget,
|
|||||||
cairo_pop_group_to_source (cr);
|
cairo_pop_group_to_source (cr);
|
||||||
|
|
||||||
cairo_paint (cr);
|
cairo_paint (cr);
|
||||||
cairo_destroy (cr);
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -948,7 +942,7 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
|
|||||||
|
|
||||||
wclass->size_request = gtk_tool_palette_size_request;
|
wclass->size_request = gtk_tool_palette_size_request;
|
||||||
wclass->size_allocate = gtk_tool_palette_size_allocate;
|
wclass->size_allocate = gtk_tool_palette_size_allocate;
|
||||||
wclass->expose_event = gtk_tool_palette_expose_event;
|
wclass->draw = gtk_tool_palette_draw;
|
||||||
wclass->realize = gtk_tool_palette_realize;
|
wclass->realize = gtk_tool_palette_realize;
|
||||||
|
|
||||||
cclass->add = gtk_tool_palette_add;
|
cclass->add = gtk_tool_palette_add;
|
||||||
|
Loading…
Reference in New Issue
Block a user