Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-10-30 11:01:34 (GMT)
committer Daniel Drake <dsd@laptop.org>2011-10-30 11:01:34 (GMT)
commitfe2ec4378a515f5ac01c1c09f9b83d1b22057c17 (patch)
treeb8d677b8bcceb53744004b7cd4da3a87a5fab710
parente1dd36a082910e4b6eeebd394f6e28df0dca253b (diff)
Tray gtk3 fixes
-rw-r--r--src/sugar3/graphics/tray.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/sugar3/graphics/tray.py b/src/sugar3/graphics/tray.py
index fcd2d24..2c9d4a0 100644
--- a/src/sugar3/graphics/tray.py
+++ b/src/sugar3/graphics/tray.py
@@ -85,32 +85,32 @@ class _TrayViewport(Gtk.Viewport):
start = item.allocation.y
stop = item.allocation.y + item.allocation.height
- if start < adj.value:
- adj.value = start
- elif stop > adj.value + adj.page_size:
- adj.value = stop - adj.page_size
+ if start < adj.get_value():
+ adj.set_value(start)
+ elif stop > adj.get_value() + adj.get_page_size():
+ adj.set_value(stop - adj.get_page_size())
def _scroll_next(self):
allocation = self.get_allocation()
if self.orientation == Gtk.Orientation.HORIZONTAL:
adj = self.get_hadjustment()
- new_value = adj.value + allocation.width
- adj.value = min(new_value, adj.upper - allocation.width)
+ new_value = adj.get_value() + allocation.width
+ adj.set_value(min(new_value, adj.get_upper() - allocation.width))
else:
adj = self.get_vadjustment()
- new_value = adj.value + allocation.height
- adj.value = min(new_value, adj.upper - allocation.height)
+ new_value = adj.get_value() + allocation.height
+ adj.set_value(min(new_value, adj.get_upper() - allocation.height))
def _scroll_previous(self):
allocation = self.get_allocation()
if self.orientation == Gtk.Orientation.HORIZONTAL:
adj = self.get_hadjustment()
- new_value = adj.value - allocation.width
- adj.value = max(adj.lower, new_value)
+ new_value = adj.get_value() - allocation.width
+ adj.set_value(max(adj.get_lower(), new_value))
else:
adj = self.get_vadjustment()
- new_value = adj.value - allocation.height
- adj.value = max(adj.lower, new_value)
+ new_value = adj.get_value() - allocation.height
+ adj.set_value(max(adj.get_lower(), new_value))
def do_size_request(self, requisition):
child_requisition = self.get_child().size_request()
@@ -130,23 +130,23 @@ class _TrayViewport(Gtk.Viewport):
return self._can_scroll_prev
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:
- scrollable = bar_requisition[0] > allocation.width
+ scrollable = bar_minimum.width > allocation.width
else:
- scrollable = bar_requisition[1] > allocation.height
+ scrollable = bar_minimum.height > allocation.height
if scrollable != self._scrollable:
self._scrollable = scrollable
self.notify('scrollable')
def _adjustment_changed_cb(self, adjustment):
- if adjustment.value <= adjustment.lower:
+ if adjustment.get_value() <= adjustment.get_lower():
can_scroll_prev = False
else:
can_scroll_prev = True
- if adjustment.value + adjustment.page_size >= adjustment.upper:
+ if adjustment.get_value() + adjustment.get_page_size() >= adjustment.get_upper():
can_scroll_next = False
else:
can_scroll_next = True