Tray: replace deprecated get_child_requisition() invocation
Widget.get_child_requisition() has been replaced by Widget.get_preferred_size() in GTK 3 [1]. [1] http://developer.gnome.org/gtk3/3.0/GtkWidget.html#gtk-widget-get-child-requisition Signed-off-by: Daniel Drake <dsd@laptop.org> [changed description] Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
This commit is contained in:
parent
7464997663
commit
157124af5b
@ -130,11 +130,11 @@ class _TrayViewport(Gtk.Viewport):
|
|||||||
return self._can_scroll_prev
|
return self._can_scroll_prev
|
||||||
|
|
||||||
def _size_allocate_cb(self, viewport, allocation):
|
def _size_allocate_cb(self, viewport, allocation):
|
||||||
bar_requisition = self.traybar.get_child_requisition()
|
bar_minimum, bar_natural = self.traybar.get_preferred_size()
|
||||||
if self.orientation == Gtk.Orientation.HORIZONTAL:
|
if self.orientation == Gtk.Orientation.HORIZONTAL:
|
||||||
scrollable = bar_requisition[0] > allocation.width
|
scrollable = bar_minimum.width > allocation.width
|
||||||
else:
|
else:
|
||||||
scrollable = bar_requisition[1] > allocation.height
|
scrollable = bar_minimum.height > allocation.height
|
||||||
|
|
||||||
if scrollable != self._scrollable:
|
if scrollable != self._scrollable:
|
||||||
self._scrollable = scrollable
|
self._scrollable = scrollable
|
||||||
|
Loading…
Reference in New Issue
Block a user