Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/graphics/tray.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2008-04-18 23:10:48 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2008-04-18 23:10:48 (GMT)
commit283b20114576b1e29d856911d188ce3c73865012 (patch)
tree3f3fbe63475506ae340590f2564dd9d4085b6dc7 /sugar/graphics/tray.py
parent8783d1113d945b25d5deedae574be52dcf4d34e5 (diff)
pylint most of sugar.graphics, only palette left
Diffstat (limited to 'sugar/graphics/tray.py')
-rw-r--r--sugar/graphics/tray.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/sugar/graphics/tray.py b/sugar/graphics/tray.py
index 064c3d0..abc8df3 100644
--- a/sugar/graphics/tray.py
+++ b/sugar/graphics/tray.py
@@ -68,27 +68,29 @@ class _TrayViewport(gtk.Viewport):
self._scroll_next()
def _scroll_next(self):
+ allocation = self.get_allocation()
if self.orientation == gtk.ORIENTATION_HORIZONTAL:
adj = self.get_hadjustment()
- new_value = adj.value + self.allocation.width
- adj.value = min(new_value, adj.upper - self.allocation.width)
+ new_value = adj.value + allocation.width
+ adj.value = min(new_value, adj.upper - allocation.width)
else:
adj = self.get_vadjustment()
- new_value = adj.value + self.allocation.height
- adj.value = min(new_value, adj.upper - self.allocation.height)
+ new_value = adj.value + allocation.height
+ adj.value = min(new_value, adj.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 - self.allocation.width
+ new_value = adj.value - allocation.width
adj.value = max(adj.lower, new_value)
else:
adj = self.get_vadjustment()
- new_value = adj.value - self.allocation.height
+ new_value = adj.value - allocation.height
adj.value = max(adj.lower, new_value)
def do_size_request(self, requisition):
- child_requisition = self.child.size_request()
+ child_requisition = self.get_child().size_request()
if self.orientation == gtk.ORIENTATION_HORIZONTAL:
requisition[0] = 0
requisition[1] = child_requisition[1]