[Sugar-devel] [PATCH 1/2] Restore page scrolling

Manuel Quiñones manuq at laptop.org
Tue Nov 29 11:29:20 EST 2011


Signed-off-by: Manuel Quiñones <manuq at laptop.org>
---
 browser.py |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/browser.py b/browser.py
index 573a9ab..58bc614 100644
--- a/browser.py
+++ b/browser.py
@@ -207,8 +207,12 @@ class TabbedView(BrowserNotebook):
         label = TabLabel(browser)
         label.connect('tab-close', self.__tab_close_cb)
 
+        scrolled_window = Gtk.ScrolledWindow()
+        scrolled_window.show()
+        scrolled_window.add(browser)
+
         next_index = self.get_current_page() + 1
-        self.insert_page(browser, label, next_index)
+        self.insert_page(scrolled_window, label, next_index)
         browser.show()
         self.set_current_page(next_index)
 
@@ -216,7 +220,11 @@ class TabbedView(BrowserNotebook):
         label = TabLabel(browser)
         label.connect('tab-close', self.__tab_close_cb)
 
-        self.append_page(browser, label)
+        scrolled_window = Gtk.ScrolledWindow()
+        scrolled_window.show()
+        scrolled_window.add(browser)
+
+        self.append_page(scrolled_window, label)
         browser.show()
         self.set_current_page(-1)
 
@@ -275,7 +283,7 @@ class TabbedView(BrowserNotebook):
             browser.load_uri(default_page)
 
     def _get_current_browser(self):
-        return self.get_nth_page(self.get_current_page())
+        return self.get_nth_page(self.get_current_page()).get_child()
 
     current_browser = GObject.property(type=object,
                                        getter=_get_current_browser)
-- 
1.7.7.3



More information about the Sugar-devel mailing list