diff options
author | dave <drykod@gmail.com> | 2009-10-29 21:08:52 (GMT) |
---|---|---|
committer | dave <drykod@gmail.com> | 2009-10-29 21:08:52 (GMT) |
commit | 99bba75b141b7d5a3d253c75c0bdf80ff26b0284 (patch) | |
tree | 12f44b0391843babff7ca28db155a49b6db21ac7 | |
parent | 4d9642d8e60cdd3b2186196a5ae435aaaecef19f (diff) |
renamed change color action/event
-rw-r--r-- | addons/changecolor.py | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/addons/changecolor.py b/addons/changecolor.py deleted file mode 100644 index ae20e8a..0000000 --- a/addons/changecolor.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (C) 2009, Tutorius.org -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -from sugar.tutorius.actions import Action - -class ChangeColor(Action): - - def __init__(self, target, color, state): - """Constructor - Change a widget color - @param target: the widget for which you want to change the color - @param color: the color you want the widget to be colorized with \ - (string)(ex: "#ffff00000000", or "red") - @param: state of the widget when you want a color change \ - (ex: gtk.STATE_NORMAL) - @return : nothing! - """ - Action.__init__(self) - self._target = target - self._state = state - #We have to get the initial color in the sugar rc theme - current_style = self._target.rc_get_style() - - self._old_color = current_style.bg[self._state] - self._new_color = gtk.gdk.color_parse(color) - - def do(self): - """Action do - Change the color of the targeted widget with the chosen color - """ - self._target.modify_bg(state,self._new_color) - - def undo(self): - """Action undo - Go back to the original color - """ - self._target.modify_bg(state,self._old_color) - - def enter_editmode(self, *args): - """ - Enters edit mode. The action should display itself in some way, - without affecting the currently running application. - """ - self._target.modify_bg(state,self._new_color) - - def exit_editmode(self, *args): - self._target.modify_bg(state,self._old_color) - -__action__ = { - "name" : "ChangeColor", - "display_name" : "Change widget color", - "icon" : "message-bubble", - "class" : ChangeColor -} - |