Adapt to Widget.get_child_requisition() API changes
In PyGTK Widget.get_child_requisition() returned a tuple [1]. In GTK3+pygi a Requisition object is returned instead. Based on a patch by Benjamin Berg <benjamin@sipsolutions.net>. [1] http://developer.gnome.org/pygtk/stable/class-gtkwidget.html#method-gtkwidget--get-child-requisition [2] http://developer.gnome.org/gtk/stable/GtkWidget.html#gtk-widget-get-child-requisition Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
This commit is contained in:
parent
0d827e7e66
commit
327ca88ca8
@ -409,9 +409,9 @@ class Icon(Gtk.Image):
|
|||||||
|
|
||||||
allocation = self.get_allocation()
|
allocation = self.get_allocation()
|
||||||
x = math.floor(allocation.x + xpad +
|
x = math.floor(allocation.x + xpad +
|
||||||
(allocation.width - requisition[0]) * xalign)
|
(allocation.width - requisition.width) * xalign)
|
||||||
y = math.floor(allocation.y + ypad +
|
y = math.floor(allocation.y + ypad +
|
||||||
(allocation.height - requisition[1]) * yalign)
|
(allocation.height - requisition.height) * yalign)
|
||||||
|
|
||||||
cr = self.get_window().cairo_create()
|
cr = self.get_window().cairo_create()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user