diff options
author | Benjamin Otte <otte@redhat.com> | 2016-12-17 20:46:25 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-12-20 18:01:11 +0100 |
commit | 65e9894450538b070ea1ab5d407b675354870f44 (patch) | |
tree | a28f3e11482e77b0daee1e2a221fe8ae64070565 /gtk/gtkmenubar.c | |
parent | e492a63e4c13c0d43d18416e5687a93d1e5115b0 (diff) | |
download | gtk+-65e9894450538b070ea1ab5d407b675354870f44.tar.gz |
menu: Implement snapshot() for the menu code
Diffstat (limited to 'gtk/gtkmenubar.c')
-rw-r--r-- | gtk/gtkmenubar.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index fa56e09201..8f2cc6dd73 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -94,8 +94,8 @@ static void gtk_menu_bar_measure_ (GtkWidget *widget, int *natural_baseline); static void gtk_menu_bar_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static gint gtk_menu_bar_draw (GtkWidget *widget, - cairo_t *cr); +static void gtk_menu_bar_snapshot (GtkWidget *widget, + GtkSnapshot *snapshot); static void gtk_menu_bar_hierarchy_changed (GtkWidget *widget, GtkWidget *old_toplevel); static gint gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell); @@ -116,7 +116,7 @@ static void gtk_menu_bar_allocate (GtkCssGadget *gadget, GtkAllocation *out_clip, gpointer data); static gboolean gtk_menu_bar_render (GtkCssGadget *gadget, - cairo_t *cr, + GtkSnapshot *snapshot, int x, int y, int width, @@ -144,7 +144,7 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class) widget_class->measure = gtk_menu_bar_measure_; widget_class->size_allocate = gtk_menu_bar_size_allocate; - widget_class->draw = gtk_menu_bar_draw; + widget_class->snapshot = gtk_menu_bar_snapshot; widget_class->hierarchy_changed = gtk_menu_bar_hierarchy_changed; menu_shell_class->submenu_placement = GTK_TOP_BOTTOM; @@ -246,8 +246,8 @@ gtk_menu_bar_init (GtkMenuBar *menu_bar) widget, gtk_menu_bar_measure, gtk_menu_bar_allocate, - gtk_menu_bar_render, NULL, + gtk_menu_bar_render, NULL, NULL); } @@ -573,7 +573,7 @@ gtk_menu_bar_size_allocate (GtkWidget *widget, static gboolean gtk_menu_bar_render (GtkCssGadget *gadget, - cairo_t *cr, + GtkSnapshot *snapshot, int x, int y, int width, @@ -582,18 +582,16 @@ gtk_menu_bar_render (GtkCssGadget *gadget, { GtkWidget *widget = gtk_css_gadget_get_owner (gadget); - GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->draw (widget, cr); + GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->snapshot (widget, snapshot); return FALSE; } -static gboolean -gtk_menu_bar_draw (GtkWidget *widget, - cairo_t *cr) +static void +gtk_menu_bar_snapshot (GtkWidget *widget, + GtkSnapshot *snapshot) { - gtk_css_gadget_draw (GTK_MENU_BAR (widget)->priv->gadget, cr); - - return FALSE; + gtk_css_gadget_snapshot (GTK_MENU_BAR (widget)->priv->gadget, snapshot); } static GList * |