Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/palettes.py
diff options
context:
space:
mode:
authorManuel QuiƱones <manuq@laptop.org>2011-09-09 02:42:35 (GMT)
committer Simon Schampijer <simon@schampijer.de>2011-09-10 06:45:49 (GMT)
commit959f86e0406914267047dc10302f98a059b6ba21 (patch)
treed5a5582f52e5af4b3bd2b95beeff604492049eff /palettes.py
parent370dfc1c167934eb4784b0444b28a493c4cc6cec (diff)
Browse: tabs usability improved
The Add Tab button has been relocated next to the tab labels, allowing more space for the URL entry. Tabs are always shown. There is at least one tab. In that case, it cannot be closed. We prevent the closing by hiding the 'X' button. Also, the close image was sugarized. There is now a fixed width for tabs. The label text does ellipsize. The width depends on the amount of tabs. There is a maximum size that is used when there is extra space. There is a minimum size to prevent hiding the information. When a new tab is opened, it now shows an empty page, not the default page. In the future, we will add a hint in this empty page, similar to what we have for an empty Journal. Added the option to "follow link in new tab" in the link's palette. Added an icon for this item, and also the icon for "follow link" is also updated. When a new tab is opened via the '+' button, the focus goes to the URL entry in the toolbar. Signed-off-by: Manuel QuiƱones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
Diffstat (limited to 'palettes.py')
-rw-r--r--palettes.py27
1 files changed, 19 insertions, 8 deletions
diff --git a/palettes.py b/palettes.py
index 9fbc370..3872c4b 100644
--- a/palettes.py
+++ b/palettes.py
@@ -140,6 +140,17 @@ class LinkPalette(Palette):
else:
self.props.primary_text = url
+ menu_item = MenuItem(_('Follow link'), 'browse-follow-link')
+ menu_item.connect('activate', self.__follow_activate_cb)
+ self.menu.append(menu_item)
+ menu_item.show()
+
+ menu_item = MenuItem(_('Follow link in new tab'),
+ 'browse-follow-link-new-tab')
+ menu_item.connect('activate', self.__follow_activate_cb, True)
+ self.menu.append(menu_item)
+ menu_item.show()
+
menu_item = MenuItem(_('Keep link'))
icon = Icon(icon_name='document-save', xo_color=profile.get_color(),
icon_size=gtk.ICON_SIZE_MENU)
@@ -156,14 +167,14 @@ class LinkPalette(Palette):
self.menu.append(menu_item)
menu_item.show()
- menu_item = MenuItem(_('Follow link'), 'edit-copy')
- menu_item.connect('activate', self.__follow_activate_cb)
- self.menu.append(menu_item)
- menu_item.show()
-
- def __follow_activate_cb(self, menu_item):
- self._browser.load_uri(self._url)
- self._browser.grab_focus()
+ def __follow_activate_cb(self, menu_item, new_tab=False):
+ if new_tab:
+ new_browser = self._browser.tabbed_view.add_tab(next_to_current=True)
+ new_browser.load_uri(self._url)
+ new_browser.grab_focus()
+ else:
+ self._browser.load_uri(self._url)
+ self._browser.grab_focus()
def __copy_activate_cb(self, menu_item):
clipboard = gtk.Clipboard()