diff options
author | Cristhofer Travieso <cristhofert97@gmail.com> | 2012-08-24 17:14:54 (GMT) |
---|---|---|
committer | Cristhofer Travieso <cristhofert97@gmail.com> | 2012-08-24 17:14:54 (GMT) |
commit | fade67fb3f562066beb19c9fab3e35a9a7a6e254 (patch) | |
tree | e0d4f0b601f1fa5b989c12dcdba03e8601b48189 | |
parent | c5ba6a09ccf4002b5dc143fa73d589b3171b8dfd (diff) |
add toolbarbox
-rw-r--r-- | activity.py | 56 | ||||
-rw-r--r-- | activity/activity.info | 2 | ||||
-rw-r--r-- | activity/icon.svg | 38 |
3 files changed, 76 insertions, 20 deletions
diff --git a/activity.py b/activity.py index 792d600..8f76475 100644 --- a/activity.py +++ b/activity.py @@ -1 +1,57 @@ +# Copyright (C) 2012 Cristhofer Travieso <cristhofert97@gmail.com> + +# 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 3 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 + +import gtk + +from sugar.activity import activity +from sugar.activity.widgets import StopButton +from sugar.activity.widgets import ActivityToolbarButton +from sugar.graphics.toolbarbox import ToolbarBox + +class Activity(activity.Activity): + def __init__(self, handle): + activity.Activity.__init__(self, handle, True) + + self.max_participants = 1 + + # Toolbar + toolbarbox = ToolbarBox() + self.set_toolbar_box(toolbarbox) + + activity_button = ActivityToolbarButton(self) + + toolbarbox.toolbar.insert(activity_button, 0) + + separator = gtk.SeparatorToolItem() + separator.set_expand(False) + separator.set_draw(True) + toolbarbox.toolbar.insert(separator, -1) + + #toolbutton + + separator = gtk.SeparatorToolItem() + separator.set_expand(True) + separator.set_draw(False) + toolbarbox.toolbar.insert(separator, -1) + + stopbtn = StopButton(self) + toolbarbox.toolbar.insert(stopbtn, -1) + + #canvas + box = gtk.VBox() + self.set_canvas(box) + + self.show_all() diff --git a/activity/activity.info b/activity/activity.info index ffee2dd..ada5d1b 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,7 +1,7 @@ [Activity] name = Tic Tac Toe activity_version = 1 -bundle_id = org.sugarlabs.Tic-Tac-Toe +bundle_id = org.sugarlabs.TicTacToe exec = sugar-activity activity.Activity -s icon = icon license = GPLv3+ diff --git a/activity/icon.svg b/activity/icon.svg index f1f5437..10cdaa1 100644 --- a/activity/icon.svg +++ b/activity/icon.svg @@ -81,16 +81,16 @@ borderopacity="1.0" id="base" inkscape:current-layer="layer1" - inkscape:cx="39.89093" + inkscape:cx="38.14093" inkscape:cy="26.577885" inkscape:document-units="px" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:window-height="864" + inkscape:window-height="804" inkscape:window-maximized="1" inkscape:window-width="1200" inkscape:window-x="0" - inkscape:window-y="0" + inkscape:window-y="30" inkscape:zoom="10" pagecolor="#ffffff" showgrid="false" @@ -123,47 +123,47 @@ d="m 18.860727,1000.3897 0,48.9451" id="path2993" inkscape:connector-curvature="0" - style="fill:none;stroke:#000000;stroke-width:1.05478823px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + style="fill:none;stroke:#ffffff;stroke-width:1.05478823000000022px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> <path d="m 37.174524,1000.3703 0,48.984" id="path2993-8" inkscape:connector-curvature="0" - style="fill:none;stroke:#000000;stroke-width:1.01571417px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + style="fill:none;stroke:#ffffff;stroke-width:1.01571417000000008px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> <g id="g3034" - style="fill:none;stroke:#000000;stroke-opacity:1" + style="fill:none;stroke:#ffffff;stroke-opacity:1" transform="matrix(0,-1,1,0,-997.56221,1081.2543)"> <path d="m 47.75287,1001.0896 0,48.9451" id="path2993-83" inkscape:connector-curvature="0" - style="fill:none;stroke:#000000;stroke-width:1.05478823000000022px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + style="fill:none;stroke:#ffffff;stroke-width:1.05478823000000022px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> <path d="m 66.066667,1001.0702 0,48.984" id="path2993-8-4" inkscape:connector-curvature="0" - style="fill:none;stroke:#000000;stroke-width:1.01571417000000008px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + style="fill:none;stroke:#ffffff;stroke-width:1.01571417000000008px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> </g> <g id="g3060" - style="stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + style="stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" transform="translate(0,17.3)"> <path d="m 5.2,1019.2622 10.7,10.7" id="path3038" inkscape:connector-curvature="0" - style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + style="fill:none;stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> <g id="g3056" - style="stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + style="stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> <g id="g3053" - style="stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + style="stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> <path d="M 16.2,21.7 5.05,32.85" id="path3040" inkscape:connector-curvature="0" - style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + style="fill:none;stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" transform="translate(0,997.36218)" /> </g> </g> @@ -176,7 +176,7 @@ sodipodi:rx="6.1999998" sodipodi:ry="6.1500001" sodipodi:type="arc" - style="fill:none;stroke:#ffffff;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + style="fill:none;stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" transform="translate(0,996.86218)" /> <g id="g3060-9-4" @@ -192,24 +192,24 @@ </g> <g id="g3060-9-9" - style="stroke:#ffffff;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + style="stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" transform="translate(35.175,-17.075)"> <path d="m 5.2,1019.2622 10.7,10.7" id="path3038-6-4" inkscape:connector-curvature="0" - style="fill:none;stroke:#ffffff;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + style="fill:none;stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> <g id="g3056-9-3" - style="stroke:#ffffff;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + style="stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> <g id="g3053-8-07" - style="stroke:#ffffff;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + style="stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> <path d="M 16.2,21.7 5.05,32.85" id="path3040-8-71" inkscape:connector-curvature="0" - style="fill:none;stroke:#ffffff;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + style="fill:none;stroke:#000000;stroke-width:1.50000000000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" transform="translate(0,997.36218)" /> </g> </g> |