From c9af045e43c9e26622b6a2db93304507064b2af7 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 21 Feb 2007 21:15:08 +0100 Subject: [PATCH] Removed MenuIcon. --- shell/view/frame/ZoomBox.py | 1 - sugar/graphics/Makefile.am | 1 - sugar/graphics/menuicon.py | 80 ------------------------------------- 3 files changed, 82 deletions(-) delete mode 100644 sugar/graphics/menuicon.py diff --git a/shell/view/frame/ZoomBox.py b/shell/view/frame/ZoomBox.py index 57bc78a5..e77e350c 100644 --- a/shell/view/frame/ZoomBox.py +++ b/shell/view/frame/ZoomBox.py @@ -19,7 +19,6 @@ from gettext import gettext as _ import hippo -from sugar.graphics.menuicon import MenuIcon from sugar.graphics.menu import Menu, MenuItem from sugar.graphics.iconcolor import IconColor from sugar.graphics.iconbutton import IconButton diff --git a/sugar/graphics/Makefile.am b/sugar/graphics/Makefile.am index 7032066d..ee1c578d 100644 --- a/sugar/graphics/Makefile.am +++ b/sugar/graphics/Makefile.am @@ -12,7 +12,6 @@ sugar_PYTHON = \ iconcolor.py \ label.py \ menu.py \ - menuicon.py \ menushell.py \ optionmenu.py \ roundbox.py \ diff --git a/sugar/graphics/menuicon.py b/sugar/graphics/menuicon.py deleted file mode 100644 index 62d12754..00000000 --- a/sugar/graphics/menuicon.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (C) 2006, Red Hat, Inc. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -import hippo -import gobject -import logging - -from sugar.graphics.canvasicon import CanvasIcon -from sugar.graphics.timeline import Timeline - -class MenuIcon(CanvasIcon): - def __init__(self, menu_shell, **kwargs): - CanvasIcon.__init__(self, **kwargs) - - self._menu_shell = menu_shell - self._menu = None - self._hover_menu = False - - self._timeline = Timeline(self) - self._timeline.add_tag('popup', 6, 6) - self._timeline.add_tag('before_popdown', 7, 7) - self._timeline.add_tag('popdown', 8, 8) - - self.connect('motion-notify-event', self._motion_notify_event_cb) - - def do_popup(self, current, n_frames): - if self._menu: - return - - self._menu = self.create_menu() - - self._menu.connect('enter-notify-event', - self._menu_enter_notify_event_cb) - self._menu.connect('leave-notify-event', - self._menu_leave_notify_event_cb) - - [x, y] = self._menu_shell.get_position(self._menu, self) - - self._menu.move(x, y) - self._menu.show() - - self._menu_shell.set_active(self) - - def do_popdown(self, current, frame): - if self._menu: - self._menu.destroy() - self._menu = None - self._menu_shell.set_active(None) - - def popdown(self): - self._timeline.play('popdown', 'popdown') - - def _motion_notify_event_cb(self, item, event): - if event.detail == hippo.MOTION_DETAIL_ENTER: - self._timeline.play(None, 'popup') - elif event.detail == hippo.MOTION_DETAIL_LEAVE: - if not self._hover_menu: - self._timeline.play('before_popdown', 'popdown') - - def _menu_enter_notify_event_cb(self, widget, event): - self._hover_menu = True - self._timeline.play('popup', 'popup') - - def _menu_leave_notify_event_cb(self, widget, event): - self._hover_menu = False - self._timeline.play('popdown', 'popdown')