[Sugar-devel] [PATCH Browse] From deprecated Gtk.HBox and Gtk.VBox to Gtk.Box

Daniel Francis francis at sugarlabs.org
Tue Jun 26 20:04:43 EDT 2012


Signed-off-by: Daniel Francis <francis at sugarlabs.org>
---
 browser.py    |    6 ++++--
 pdfviewer.py  |    3 ++-
 webtoolbar.py |    6 ++++--
 widgets.py    |    3 ++-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/browser.py b/browser.py
index 7379d2b..4091052 100644
--- a/browser.py
+++ b/browser.py
@@ -347,7 +347,7 @@ class TabPage(Gtk.ScrolledWindow):
                                getter=_get_browser)
 
 
-class TabLabel(Gtk.HBox):
+class TabLabel(Gtk.Box):
     __gtype_name__ = 'BrowseTabLabel'
 
     __gsignals__ = {
@@ -358,6 +358,7 @@ class TabLabel(Gtk.HBox):
 
     def __init__(self, browser):
         GObject.GObject.__init__(self)
+        self.set_orientation(Gtk.Orientation.HORIZONTAL)
 
         browser.connect('notify::title', self.__title_changed_cb)
         browser.connect('notify::load-status', self.__load_status_changed_cb)
@@ -373,7 +374,8 @@ class TabLabel(Gtk.HBox):
         button = Gtk.Button()
         button.props.relief = Gtk.ReliefStyle.NONE
         button.props.focus_on_click = False
-        icon_box = Gtk.HBox()
+        icon_box = Gtk.Box()
+        icon_box.set_orientation(Gtk.Orientation.HORIZONTAL)
         icon_box.pack_start(close_tab_icon, True, False, 0)
         button.add(icon_box)
         button.connect('clicked', self.__button_clicked_cb)
diff --git a/pdfviewer.py b/pdfviewer.py
index 5f607bf..0577989 100644
--- a/pdfviewer.py
+++ b/pdfviewer.py
@@ -271,13 +271,14 @@ class DummyBrowser(GObject.GObject):
         pass
 
 
-class PDFTabPage(Gtk.HBox):
+class PDFTabPage(Gtk.Box):
     """Shows a basic PDF viewer, download the file first if the PDF is
     in a remote location.
 
     """
     def __init__(self):
         GObject.GObject.__init__(self)
+        self.set_orientation(Gtk.Orientation.HORIZONTAL)
         self._browser = DummyBrowser(self)
         self._evince_viewer = None
         self._pdf_uri = None
diff --git a/webtoolbar.py b/webtoolbar.py
index 28bc015..ddbb0bf 100644
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -275,7 +275,8 @@ class PrimaryToolbar(ToolbarBase):
         self._back.show()
 
         palette = self._back.get_palette()
-        self._back_box_menu = Gtk.VBox()
+        self._back_box_menu = Gtk.Box()
+        self._back_box_menu.set_orientation(Gtk.Orientation.VERTICAL)
         self._back_box_menu.show()
         palette.set_content(self._back_box_menu)
         # FIXME, this is a hack, should be done in the theme:
@@ -289,7 +290,8 @@ class PrimaryToolbar(ToolbarBase):
         self._forward.show()
 
         palette = self._forward.get_palette()
-        self._forward_box_menu = Gtk.VBox()
+        self._forward_box_menu = Gtk.Box()
+        self._forward_box_menu.set_orientation(Gtk.Orientation.VERTICAL)
         self._forward_box_menu.show()
         palette.set_content(self._forward_box_menu)
         # FIXME, this is a hack, should be done in the theme:
diff --git a/widgets.py b/widgets.py
index df5bdb0..7ef3474 100644
--- a/widgets.py
+++ b/widgets.py
@@ -22,7 +22,7 @@ from gi.repository import Gtk
 from sugar3.graphics.icon import Icon
 
 
-class TabAdd(Gtk.HBox):
+class TabAdd(Gtk.Box):
     __gtype_name__ = 'BrowseTabAdd'
 
     __gsignals__ = {
@@ -33,6 +33,7 @@ class TabAdd(Gtk.HBox):
 
     def __init__(self):
         GObject.GObject.__init__(self)
+        self.set_orientation(Gtk.Orientation.HORIZONTAL)
 
         add_tab_icon = Icon(icon_name='add')
         button = Gtk.Button()
-- 
1.7.10.2



More information about the Sugar-devel mailing list