From 0ebba0d454a2243e7a683d0f0c279c559d0f9c4c Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 30 Apr 2007 23:07:08 +0000 Subject: Drop the old hippo based toggle --- diff --git a/sugar/graphics/Makefile.am b/sugar/graphics/Makefile.am index eb4b379..86f3d97 100644 --- a/sugar/graphics/Makefile.am +++ b/sugar/graphics/Makefile.am @@ -17,7 +17,6 @@ sugar_PYTHON = \ popupcontext.py \ snowflakebox.py \ spreadbox.py \ - toggleiconbutton.py \ toolbar.py \ toolbox.py \ toolbutton.py \ diff --git a/sugar/graphics/toggleiconbutton.py b/sugar/graphics/toggleiconbutton.py deleted file mode 100644 index a624cf4..0000000 --- a/sugar/graphics/toggleiconbutton.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright (C) 2007, Red Hat -# -# 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. - -# -# DEPRECATED. Do not use in new code. We will reimplement it in gtk -# - -import gobject -import hippo - -from sugar.graphics.iconbutton import IconButton -from sugar.graphics import color - -class ToggleIconButton(IconButton, hippo.CanvasItem): - __gtype_name__ = 'SugarToggleIconButton' - - __gproperties__ = { - 'toggled' : (bool, None, None, False, - gobject.PARAM_READWRITE) - } - - def __init__(self, **kwargs): - self._toggled = False - - IconButton.__init__(self, **kwargs) - - def _get_bg_color(self): - if self._toggled: - col = color.TOGGLE_BUTTON_BACKGROUND - else: - col = color.BUTTON_BACKGROUND_NORMAL - - return col.get_int() - - def _set_toggled(self, toggled): - self._toggled = toggled - self.props.background_color = self._get_bg_color() - - def do_set_property(self, pspec, value): - if pspec.name == 'toggled': - self._set_toggled(value) - else: - IconButton.do_set_property(self, pspec, value) - - def do_get_property(self, pspec): - if pspec.name == 'toggled': - return self._toggled - - return IconButton.do_get_property(self, pspec) - - def do_button_press_event(self, event): - self.props.toggled = not self._toggled - return IconButton.do_button_press_event(self, event) - - def prelight(self, enter): - if enter and not self._toggled: - IconButton.prelight(self, enter) - else: - self.props.background_color = self._get_bg_color() -- cgit v0.9.1