From 12192e974fcee1918e4bfa0a6c5febaea4bc2726 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 30 Apr 2007 16:31:30 +0200 Subject: [PATCH 1/4] Tweaks for themability --- sugar/graphics/panel.py | 23 +++++++++++++++++++++++ sugar/graphics/toolbox.py | 1 + 2 files changed, 24 insertions(+) create mode 100644 sugar/graphics/panel.py diff --git a/sugar/graphics/panel.py b/sugar/graphics/panel.py new file mode 100644 index 00000000..bf3ed243 --- /dev/null +++ b/sugar/graphics/panel.py @@ -0,0 +1,23 @@ +# 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. + +import gtk + +class Panel(gtk.VBox): + __gtype_name__ = 'SugarPanel' + def __init__(self): + gtk.VBox.__init__(self) diff --git a/sugar/graphics/toolbox.py b/sugar/graphics/toolbox.py index 441d157b..6dd805f1 100644 --- a/sugar/graphics/toolbox.py +++ b/sugar/graphics/toolbox.py @@ -26,6 +26,7 @@ class Toolbox(gtk.VBox): gtk.VBox.__init__(self) self._notebook = gtk.Notebook() + self._notebook.set_name('sugar-toolbox-notebook') self._notebook.set_tab_pos(gtk.POS_BOTTOM) self._notebook.set_show_border(False) self.pack_start(self._notebook) From 8cb5170566c3477ad428a99bccc1bfa39d659f11 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 30 Apr 2007 17:30:55 +0200 Subject: [PATCH 2/4] Add missing files --- sugar/graphics/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sugar/graphics/Makefile.am b/sugar/graphics/Makefile.am index 6756aa93..eb4b3795 100644 --- a/sugar/graphics/Makefile.am +++ b/sugar/graphics/Makefile.am @@ -2,6 +2,7 @@ sugardir = $(pythondir)/sugar/graphics sugar_PYTHON = \ __init__.py \ animator.py \ + icon.py \ iconbutton.py \ canvasicon.py \ color.py \ @@ -11,6 +12,7 @@ sugar_PYTHON = \ menu.py \ menushell.py \ roundbox.py \ + panel.py \ popup.py \ popupcontext.py \ snowflakebox.py \ From bb8417f57b3b79392febd9e1dde70523df259c1e Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 30 Apr 2007 18:59:55 +0200 Subject: [PATCH 3/4] Added sugar.activity.activity.EditToolbar. --- sugar/activity/activity.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index fa5b8882..a859810c 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -64,6 +64,31 @@ class ActivityToolbar(gtk.Toolbar): def _activity_shared_cb(self, activity): self._share_button.set_sensitive(False) +class EditToolbar(gtk.Toolbar): + def __init__(self): + gtk.Toolbar.__init__(self) + + self.undo = ToolButton('edit-undo') + self.insert(self.undo, -1) + self.undo.show() + + self.redo = ToolButton('edit-redo') + self.insert(self.redo, -1) + self.redo.show() + + separator = gtk.SeparatorToolItem() + separator.set_draw(True) + self.insert(separator, -1) + separator.show() + + self.copy = ToolButton('edit-copy') + self.insert(self.copy, -1) + self.copy.show() + + self.paste = ToolButton('edit-paste') + self.insert(self.paste, -1) + self.paste.show() + class ActivityToolbox(Toolbox): def __init__(self, activity): Toolbox.__init__(self) From e78c9d21a9070a4bcfd5f3ab7fcabc4542808e75 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 30 Apr 2007 19:00:34 +0200 Subject: [PATCH 4/4] Added ToggleToolButton control. --- sugar/graphics/toggletoolbutton.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sugar/graphics/toggletoolbutton.py diff --git a/sugar/graphics/toggletoolbutton.py b/sugar/graphics/toggletoolbutton.py new file mode 100644 index 00000000..09ec0efb --- /dev/null +++ b/sugar/graphics/toggletoolbutton.py @@ -0,0 +1,28 @@ +# 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. + +import gtk + +from sugar.graphics.icon import Icon + +class ToggleToolButton(gtk.ToggleToolButton): + def __init__(self, icon_resource=None): + gtk.ToggleToolButton.__init__(self) + + icon = Icon(icon_resource) + self.set_icon_widget(icon) + icon.show()