Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2012-06-28 11:31:14 (GMT)
committer Simon Schampijer <simon@schampijer.de>2012-06-28 11:31:14 (GMT)
commitb025638732e66684ea7d2c49b67277f391051e99 (patch)
tree221e9a5180381c0c0f2415cb58f67201aea1ee46
parent94021285edb515f3a705cae8c892c0a2597b9ab4 (diff)
ControlPanel AboutMe section: use the EventIcon from the toolkit
We had a similar implmentation of the EventIcon in this section, now we can reuse the one from the toolkit.
-rw-r--r--extensions/cpsection/aboutme/view.py27
1 files changed, 4 insertions, 23 deletions
diff --git a/extensions/cpsection/aboutme/view.py b/extensions/cpsection/aboutme/view.py
index 84daec7..d68167e 100644
--- a/extensions/cpsection/aboutme/view.py
+++ b/extensions/cpsection/aboutme/view.py
@@ -19,7 +19,7 @@ import gtk
import gobject
from gettext import gettext as _
-from sugar.graphics.icon import Icon
+from sugar.graphics.icon import EventIcon
from sugar.graphics import style
from sugar.graphics.xocolor import XoColor, colors
@@ -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: