From caf63a14cb8ebef3aae0de5b319d1a8b9116c86c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 9 Feb 2016 23:48:48 -0800 Subject: [PATCH] avoid deprecated gtk_widget_get_requisition() --- src/gtk/toolbar.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp index b418965623..ff5bcdefa4 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -187,15 +187,13 @@ image_expose_event(GtkWidget* widget, GdkEventExpose*, wxToolBarTool* tool) // draw disabled bitmap ourselves, GtkImage has no way to specify it GtkAllocation alloc; gtk_widget_get_allocation(widget, &alloc); - GtkRequisition req; - gtk_widget_get_requisition(widget, &req); + int x = (alloc.width - bitmap.GetWidth()) / 2; + int y = (alloc.height - bitmap.GetHeight()) / 2; #ifdef __WXGTK3__ - const int x = (alloc.width - req.width) / 2; - const int y = (alloc.height - req.height) / 2; bitmap.Draw(cr, x, y); #else - const int x = alloc.x + (alloc.width - req.width) / 2; - const int y = alloc.y + (alloc.height - req.height) / 2; + x += alloc.x; + y += alloc.y; gdk_draw_pixbuf( gtk_widget_get_window(widget), gtk_widget_get_style(widget)->black_gc, bitmap.GetPixbuf(), 0, 0, x, y,