diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2016-04-13 15:59:14 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2016-04-13 15:59:14 +0000 |
| commit | 24397ca99c5807898ee423669bb2a089f51bc787 (patch) | |
| tree | a0a45404d39045ee6d9ad2e1b7b6123b6247c44c /src/widgets/icon.cpp | |
| parent | Move page border below the drawing. (diff) | |
| download | inkscape-24397ca99c5807898ee423669bb2a089f51bc787.tar.gz inkscape-24397ca99c5807898ee423669bb2a089f51bc787.zip | |
icon: Fix deprecated gtk_widget_get_requisition() #Hackfest2016
(bzr r14839)
Diffstat (limited to 'src/widgets/icon.cpp')
| -rw-r--r-- | src/widgets/icon.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index f998cd66d..010b3a6fb 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -280,7 +280,13 @@ gboolean IconImpl::draw(GtkWidget *widget, cairo_t* cr) GtkAllocation allocation; GtkRequisition requisition; gtk_widget_get_allocation(widget, &allocation); + +#if GTK_CHECK_VERSION(3,0,0) + gtk_widget_get_preferred_size(widget, &requisition, NULL); +#else gtk_widget_get_requisition(widget, &requisition); +#endif + int x = floor(allocation.x + ((allocation.width - requisition.width) * 0.5)); int y = floor(allocation.y + ((allocation.height - requisition.height) * 0.5)); int width = gdk_pixbuf_get_width(image); |
