From 0c503aaa14f6d4c300603ea463eb070f0a7733ed Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Fri, 12 Oct 2012 12:20:19 +0000 Subject: Keep the typed URL after switching between tabs SL #3537 This patch allows the user to start typing an URL and switch to another tag. Then go back to the previous tab and keep typing the same URL. Signed-off-by: Manuel Kaufmann Acked-by: Manuel QuiƱones --- (limited to 'webtoolbar.py') diff --git a/webtoolbar.py b/webtoolbar.py index 6350dfb..29c036b 100644 --- a/webtoolbar.py +++ b/webtoolbar.py @@ -239,6 +239,7 @@ class PrimaryToolbar(ToolbarBase): self.entry.connect('activate', self._entry_activate_cb) self.entry.connect('focus-in-event', self.__focus_in_event_cb) self.entry.connect('focus-out-event', self.__focus_out_event_cb) + self.entry.connect('key-press-event', self.__key_press_event_cb) entry_item = Gtk.ToolItem() entry_item.set_expand(True) @@ -298,6 +299,9 @@ class PrimaryToolbar(ToolbarBase): tabbed_view.connect_after('switch-page', self.__switch_page_cb) + def __key_press_event_cb(self, entry, event): + self._tabbed_view.current_browser.loading_uri = entry.props.text + def __switch_page_cb(self, tabbed_view, page, page_num): if tabbed_view.get_n_pages(): self._connect_to_browser(tabbed_view.props.current_browser) -- cgit v0.9.1