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 07:03:10 (GMT)
committer Daniel Drake <dsd@laptop.org>2011-10-30 07:03:25 (GMT)
commit6b49705a6c1b07f0ae63810171edd22c8d136c86 (patch)
treec7ac551f3cad37a14b1385a6a1344d0755fbd4ec
parent52db397301471e7ab3ca612cce4e97cb2d2f8eb4 (diff)
Gtk.Orientation fixups
-rw-r--r--src/sugar3/graphics/palettewindow.py2
-rw-r--r--src/sugar3/graphics/tray.py16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py
index 296a0b1..57d7932 100644
--- a/src/sugar3/graphics/palettewindow.py
+++ b/src/sugar3/graphics/palettewindow.py
@@ -856,7 +856,7 @@ class ToolInvoker(WidgetInvoker):
if parent is None:
return WidgetInvoker._get_alignments(self)
- if parent.get_orientation() is Gtk.ORIENTATION_HORIZONTAL:
+ if parent.get_orientation() is Gtk.Orientation.HORIZONTAL:
return self.BOTTOM + self.TOP
else:
return self.LEFT + self.RIGHT
diff --git a/src/sugar3/graphics/tray.py b/src/sugar3/graphics/tray.py
index 6a65d5f..42d0950 100644
--- a/src/sugar3/graphics/tray.py
+++ b/src/sugar3/graphics/tray.py
@@ -58,7 +58,7 @@ class _TrayViewport(Gtk.Viewport):
self.connect('size_allocate', self._size_allocate_cb)
- if self.orientation == Gtk.ORIENTATION_HORIZONTAL:
+ if self.orientation == Gtk.Orientation.HORIZONTAL:
adj = self.get_hadjustment()
else:
adj = self.get_vadjustment()
@@ -76,7 +76,7 @@ class _TrayViewport(Gtk.Viewport):
assert item in self.traybar.get_children()
# Get the allocation, and make sure that it is visible
- if self.orientation == Gtk.ORIENTATION_HORIZONTAL:
+ if self.orientation == Gtk.Orientation.HORIZONTAL:
adj = self.get_hadjustment()
start = item.allocation.x
stop = item.allocation.x + item.allocation.width
@@ -92,7 +92,7 @@ class _TrayViewport(Gtk.Viewport):
def _scroll_next(self):
allocation = self.get_allocation()
- if self.orientation == Gtk.ORIENTATION_HORIZONTAL:
+ 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)
@@ -103,7 +103,7 @@ class _TrayViewport(Gtk.Viewport):
def _scroll_previous(self):
allocation = self.get_allocation()
- if self.orientation == Gtk.ORIENTATION_HORIZONTAL:
+ if self.orientation == Gtk.Orientation.HORIZONTAL:
adj = self.get_hadjustment()
new_value = adj.value - allocation.width
adj.value = max(adj.lower, new_value)
@@ -114,7 +114,7 @@ class _TrayViewport(Gtk.Viewport):
def do_size_request(self, requisition):
child_requisition = self.get_child().size_request()
- if self.orientation == Gtk.ORIENTATION_HORIZONTAL:
+ if self.orientation == Gtk.Orientation.HORIZONTAL:
requisition[0] = 0
requisition[1] = child_requisition[1]
else:
@@ -131,7 +131,7 @@ class _TrayViewport(Gtk.Viewport):
def _size_allocate_cb(self, viewport, allocation):
bar_requisition = self.traybar.get_child_requisition()
- if self.orientation == Gtk.ORIENTATION_HORIZONTAL:
+ if self.orientation == Gtk.Orientation.HORIZONTAL:
scrollable = bar_requisition[0] > allocation.width
else:
scrollable = bar_requisition[1] > allocation.height
@@ -235,7 +235,7 @@ class HTray(Gtk.HBox):
scroll_left = _TrayScrollButton('go-left', _PREVIOUS_PAGE)
self.pack_start(scroll_left, False, False, 0)
- self._viewport = _TrayViewport(Gtk.ORIENTATION_HORIZONTAL)
+ self._viewport = _TrayViewport(Gtk.Orientation.HORIZONTAL)
self.pack_start(self._viewport, True, True, 0)
self._viewport.show()
@@ -321,7 +321,7 @@ class VTray(Gtk.VBox):
scroll_up = _TrayScrollButton('go-up', _PREVIOUS_PAGE)
self.pack_start(scroll_up, False, False, 0)
- self._viewport = _TrayViewport(Gtk.ORIENTATION_VERTICAL)
+ self._viewport = _TrayViewport(Gtk.Orientation.VERTICAL)
self.pack_start(self._viewport, True, True, 0)
self._viewport.show()