Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
path: root/webtoolbar.py
diff options
authorManuel Kaufmann <humitos@gmail.com>2012-11-23 13:23:59 (GMT)
committer Simon Schampijer <simon@laptop.org>2012-11-23 17:20:50 (GMT)
commit7d255fd28fac26693c3b42743171659bad9df208 (patch)
tree3b26810330a3a06d3cbf21f1333dae7e4d84e43d /webtoolbar.py
parentb3d2fa7df31a637e044dc6f1c77591dc1aa33f06 (diff)
Use the PaletteMenuItem from the toolkit instead of local SugarMenuItem, part of SL #3455
With this patch Browse uses PaletteMenuItem from 'sugar3.graphics.palettemenu' instead of the local SugarMenuItem defined by Browse in the "sugarmenuitem" module. The local module will be removed as well. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Acked-by: Simon Schampijer <simon@laptop.org>
Diffstat (limited to 'webtoolbar.py')
1 files changed, 5 insertions, 3 deletions
diff --git a/webtoolbar.py b/webtoolbar.py
index 3a0ec57..642b310 100644
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -27,13 +27,13 @@ from gi.repository import WebKit
from sugar3.graphics.toolbutton import ToolButton
from sugar3.graphics import iconentry
from sugar3.graphics.toolbarbox import ToolbarBox as ToolbarBase
+from sugar3.graphics.palettemenu import PaletteMenuItem
from sugar3.graphics import style
from sugar3.activity.widgets import ActivityToolbarButton
from sugar3.activity.widgets import StopButton
import filepicker
import places
-from sugarmenuitem import SugarMenuItem
from browser import Browser
from pdfviewer import DummyBrowser
@@ -492,8 +492,8 @@ class PrimaryToolbar(ToolbarBase):
if not isinstance(title, unicode):
title = unicode(title, 'utf-8')
# This is a fix until the Sugar MenuItem is fixed:
- menu_item = SugarMenuItem(text_label=title)
- menu_item.connect('clicked', self._history_item_activated_cb,
+ menu_item = PaletteMenuItem(text_label=title)
+ menu_item.connect('activate', self._history_item_activated_cb,
return menu_item
@@ -519,6 +519,8 @@ class PrimaryToolbar(ToolbarBase):
item_index += 1
def _history_item_activated_cb(self, menu_item, index):
+ self._back.get_palette().popdown(immediate=True)
+ self._forward.get_palette().popdown(immediate=True)
def _link_add_clicked_cb(self, button):