diff options
author | Simon Schampijer <simon@schampijer.de> | 2011-10-29 13:49:52 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2011-10-29 13:49:52 (GMT) |
commit | 6f60ddefa69f6ae5f1d672fc0d8db1bd1dbfd32a (patch) | |
tree | f2d82e65b39c71392f168217746cda3d453650f7 | |
parent | 786fb3cabab0bb2e4afe3d39838a70fc45e771c3 (diff) |
Remove the last parts for hippo
-rw-r--r-- | src/sugar3/graphics/Makefile.am | 3 | ||||
-rw-r--r-- | src/sugar3/graphics/canvastextview.py | 41 | ||||
-rw-r--r-- | src/sugar3/graphics/entry.py | 41 | ||||
-rw-r--r-- | src/sugar3/graphics/roundbox.py | 71 |
4 files changed, 0 insertions, 156 deletions
diff --git a/src/sugar3/graphics/Makefile.am b/src/sugar3/graphics/Makefile.am index a4bc0b0..332060f 100644 --- a/src/sugar3/graphics/Makefile.am +++ b/src/sugar3/graphics/Makefile.am @@ -2,10 +2,8 @@ sugardir = $(pythondir)/sugar3/graphics sugar_PYTHON = \ alert.py \ animator.py \ - canvastextview.py \ colorbutton.py \ combobox.py \ - entry.py \ iconentry.py \ icon.py \ __init__.py \ @@ -18,7 +16,6 @@ sugar_PYTHON = \ panel.py \ radiopalette.py \ radiotoolbutton.py \ - roundbox.py \ style.py \ toggletoolbutton.py \ toolbarbox.py \ diff --git a/src/sugar3/graphics/canvastextview.py b/src/sugar3/graphics/canvastextview.py deleted file mode 100644 index 899a513..0000000 --- a/src/sugar3/graphics/canvastextview.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2008 One Laptop Per Child -# -# 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. - -from gi.repository import Gtk -from gi.repository import Hippo - -from sugar3.graphics import style - - -class CanvasTextView(Hippo.CanvasWidget): - - def __init__(self, text, **kwargs): - gobject.GObject.__init__(self, **kwargs) - self.text_view_widget = Gtk.TextView() - self.text_view_widget.props.buffer.props.text = text - self.text_view_widget.props.left_margin = style.DEFAULT_SPACING - self.text_view_widget.props.right_margin = style.DEFAULT_SPACING - self.text_view_widget.props.wrap_mode = Gtk.WrapMode.WORD - self.text_view_widget.show() - - # TODO: These fields should expand vertically instead of scrolling - scrolled_window = Gtk.ScrolledWindow() - scrolled_window.set_shadow_type(Gtk.ShadowType.OUT) - scrolled_window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) - scrolled_window.add(self.text_view_widget) - - self.props.widget = scrolled_window diff --git a/src/sugar3/graphics/entry.py b/src/sugar3/graphics/entry.py deleted file mode 100644 index 1a34687..0000000 --- a/src/sugar3/graphics/entry.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2007, 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. - -""" -STABLE. -""" - -from gi.repository import Gtk -from gi.repository import Hippo - - -class CanvasEntry(Hippo.CanvasEntry): - - def set_background(self, color_spec): - """ - Parameters - ---------- - color_spec : - - Returns - ------- - None - - """ - color = Gdk.color_parse(color_spec) - self.props.widget.modify_bg(Gtk.StateType.INSENSITIVE, color) - self.props.widget.modify_base(Gtk.StateType.INSENSITIVE, color) diff --git a/src/sugar3/graphics/roundbox.py b/src/sugar3/graphics/roundbox.py deleted file mode 100644 index 264c402..0000000 --- a/src/sugar3/graphics/roundbox.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 2006-2007 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. - -""" -STABLE. -""" - -import math - -from gi.repository import Hippo - -from sugar3.graphics import style - - -class CanvasRoundBox(Hippo.CanvasBox, Hippo.CanvasItem): - __gtype_name__ = 'SugarRoundBox' - - _BORDER_DEFAULT = style.LINE_WIDTH - - def __init__(self, **kwargs): - gobject.GObject.__init__(self, **kwargs) - - # TODO: we should calculate radius depending on the height of the box. - self._radius = style.zoom(10) - - self.props.orientation = Hippo.Orientation.HORIZONTAL - self.props.border = self._BORDER_DEFAULT - self.props.border_left = self._radius - self.props.border_right = self._radius - self.props.border_color = style.COLOR_BLACK.get_int() - - def do_paint_background(self, cr, damaged_box): - [width, height] = self.get_allocation() - - x = self._BORDER_DEFAULT / 2 - y = self._BORDER_DEFAULT / 2 - width -= self._BORDER_DEFAULT - height -= self._BORDER_DEFAULT - - cr.move_to(x + self._radius, y) - cr.arc(x + width - self._radius, y + self._radius, - self._radius, math.pi * 1.5, math.pi * 2) - cr.arc(x + width - self._radius, x + height - self._radius, - self._radius, 0, math.pi * 0.5) - cr.arc(x + self._radius, y + height - self._radius, - self._radius, math.pi * 0.5, math.pi) - cr.arc(x + self._radius, y + self._radius, self._radius, - math.pi, math.pi * 1.5) - - Hippo.cairo_set_source_rgba32(cr, self.props.background_color) - cr.fill_preserve() - - # TODO: we should be more consistent here with the border properties. - if self.props.border_color: - Hippo.cairo_set_source_rgba32(cr, self.props.border_color) - cr.set_line_width(self.props.border_top) - cr.stroke() |