diff options
author | Simon Schampijer <simon@schampijer.de> | 2012-08-06 07:49:24 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2012-08-13 21:15:43 (GMT) |
commit | 5ad6ae0166db14d384c9d4cbf53575de015d29f4 (patch) | |
tree | 8a43b4055a740e30c9a6bc7a2108d80c401e398b /extensions | |
parent | b06ab21cc59200adf59ebb27e8e7e209ce494cba (diff) |
ControlPanel AboutMe section: use the EventIcon from the shell
We had a similar implmentation of the EventIcon in this section, now
we can reuse the one from the shell.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/cpsection/aboutme/view.py | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/extensions/cpsection/aboutme/view.py b/extensions/cpsection/aboutme/view.py index 84daec7..ea7c7c8 100644 --- a/extensions/cpsection/aboutme/view.py +++ b/extensions/cpsection/aboutme/view.py @@ -19,12 +19,12 @@ import gtk import gobject from gettext import gettext as _ -from sugar.graphics.icon import Icon from sugar.graphics import style from sugar.graphics.xocolor import XoColor, colors from jarabe.controlpanel.sectionview import SectionView from jarabe.controlpanel.inlinealert import InlineAlert +from jarabe.view.eventicon import EventIcon _STROKE_COLOR = 0 _FILL_COLOR = 1 @@ -111,22 +111,6 @@ _NEXT_STROKE_COLOR = 3 _PREVIOUS_STROKE_COLOR = 4 -class EventIcon(gtk.EventBox): - __gtype_name__ = 'SugarEventIcon' - - def __init__(self, **kwargs): - gtk.EventBox.__init__(self) - - self.icon = Icon(pixel_size=style.XLARGE_ICON_SIZE, **kwargs) - - self.set_visible_window(False) - self.set_app_paintable(True) - self.set_events(gtk.gdk.BUTTON_PRESS_MASK) - - self.add(self.icon) - self.icon.show() - - class ColorPicker(EventIcon): __gsignals__ = { 'color-changed': (gobject.SIGNAL_RUN_FIRST, @@ -135,14 +119,11 @@ class ColorPicker(EventIcon): } def __init__(self, picker): - EventIcon.__init__(self) - - self.icon.props.icon_name = 'computer-xo' + EventIcon.__init__(self, icon_name='computer-xo', + pixel_size=style.XLARGE_ICON_SIZE) self._picker = picker self._color = None - self.icon.props.pixel_size = style.XLARGE_ICON_SIZE - self.connect('button_press_event', self.__pressed_cb, picker) def update(self, color): @@ -156,7 +137,7 @@ class ColorPicker(EventIcon): self._color = XoColor(_get_next_stroke_color(color)) else: self._color = color - self.icon.props.xo_color = self._color + self.props.xo_color = self._color def __pressed_cb(self, button, event, picker): if picker != _CURRENT_COLOR: |