diff options
author | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-08-27 23:10:39 (GMT) |
---|---|---|
committer | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-08-28 15:22:05 (GMT) |
commit | a81918f8bdafc9b67399aa7316ee892efaf08d48 (patch) | |
tree | 3b1bba443ea598fee1332b6d81d9a29302dcd977 | |
parent | a928af4e42c060339d25a22639aa56df67fb449b (diff) |
Relocate and remove some toolitems
Changes:
* Remove vs_computer and vs_person
* Put the score button into the activity toolbar
* Put the help button before the fill separator.
* Remove unneeded code
Signed-off-by: Agustin Zubiaga <aguz@sugarlabs.org>
-rw-r--r-- | activity.py | 67 | ||||
-rw-r--r-- | dialogs.py | 5 | ||||
-rw-r--r-- | icons/human.svg | 7 | ||||
-rw-r--r-- | icons/robot.svg | 99 |
4 files changed, 31 insertions, 147 deletions
diff --git a/activity.py b/activity.py index 13533b7..56a3c8d 100644 --- a/activity.py +++ b/activity.py @@ -1,4 +1,5 @@ # Copyright (C) 2012 Cristhofer Travieso <cristhofert97@gmail.com> +# Copyright (C) 2012 Agustin Zubiaga <aguz@sugarlabs.org> # 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 @@ -35,68 +36,58 @@ class Activity(activity.Activity): toolbarbox.toolbar.insert(activity_button, 0) separator = Gtk.SeparatorToolItem() - separator.set_expand(False) - separator.set_draw(True) + activity_button.page.insert(separator, -1) + + score_btn = ToolButton() + score_btn.props.icon_name = 'score' + activity_button.page.insert(score_btn, -1) + score_btn.show() + + separator = Gtk.SeparatorToolItem() toolbarbox.toolbar.insert(separator, -1) - #toolbutton - self._new_game_btn = ToolButton() - self._new_game_btn.set_tooltip('New Game') - self._new_game_btn.props.icon_name = 'new-game' - toolbarbox.toolbar.insert(self._new_game_btn, -1) + # ToolButtons + new_game_btn = ToolButton() + new_game_btn.set_tooltip('New Game') + new_game_btn.props.icon_name = 'new-game' + toolbarbox.toolbar.insert(new_game_btn, -1) separator = Gtk.SeparatorToolItem() separator.set_expand(False) separator.set_draw(True) toolbarbox.toolbar.insert(separator, -1) - self._cross_btn = RadioToolButton() - self._cross_btn.set_tooltip('Cross') - self._cross_btn.props.icon_name = 'cross' - toolbarbox.toolbar.insert(self._cross_btn, -1) + cross_btn = RadioToolButton() + cross_btn.set_tooltip('Cross') + cross_btn.props.icon_name = 'cross' + toolbarbox.toolbar.insert(cross_btn, -1) - self._circle_btn = RadioToolButton() - self._circle_btn.set_tooltip('Circle') - self._circle_btn.props.icon_name = 'circle' - self._circle_btn.props.group = self._cross_btn - toolbarbox.toolbar.insert(self._circle_btn, -1) + circle_btn = RadioToolButton() + circle_btn.set_tooltip('Circle') + circle_btn.props.icon_name = 'circle' + circle_btn.props.group = cross_btn + toolbarbox.toolbar.insert(circle_btn, -1) separator = Gtk.SeparatorToolItem() - separator.set_expand(False) - separator.set_draw(True) toolbarbox.toolbar.insert(separator, -1) - self._vs_human_btn = RadioToolButton() - self._vs_human_btn.set_tooltip('Play against a person') - self._vs_human_btn.props.icon_name = 'human' - toolbarbox.toolbar.insert(self._vs_human_btn, -1) - - self._vs_robot_btn = RadioToolButton() - self._vs_robot_btn.set_tooltip('Play against the computer') - self._vs_robot_btn.props.icon_name = 'robot' - self._vs_robot_btn.props.group = self._vs_human_btn - toolbarbox.toolbar.insert(self._vs_robot_btn, -1) + help_btn = ToolButton() + help_btn.set_tooltip('Help') + help_btn.props.icon_name = 'help-icon' + toolbarbox.toolbar.insert(help_btn, -1) separator = Gtk.SeparatorToolItem() separator.set_expand(True) separator.set_draw(False) toolbarbox.toolbar.insert(separator, -1) - self._score_btn = ToolButton() - self._score_btn.props.icon_name = 'score' - toolbarbox.toolbar.insert(self._score_btn, -1) - - self._help_btn = ToolButton() - self._help_btn.set_tooltip('Help') - self._help_btn.props.icon_name = 'help-icon' - toolbarbox.toolbar.insert(self._help_btn, -1) - stopbtn = StopButton(self) toolbarbox.toolbar.insert(stopbtn, -1) - #canvas + # Canvas drawingarea = Gtk.DrawingArea() self.set_canvas(drawingarea) self.set_toolbar_box(toolbarbox) self.show_all() + @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- - -# From Ingenium Machina by Gonzalo Odiard and Manuel QuiƱones +# Copyright (C) 2012 Agustin Zubiaga <aguz@sugarlabs.org> +# 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 diff --git a/icons/human.svg b/icons/human.svg deleted file mode 100644 index b673179..0000000 --- a/icons/human.svg +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ - <!ENTITY stroke_color "#010101"> - <!ENTITY fill_color "#FFFFFF"> -]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="stock-xo_1_"> - <path d="M33.233,35.1l10.102,10.1c0.752,0.75,1.217,1.783,1.217,2.932 c0,2.287-1.855,4.143-4.146,4.143c-1.145,0-2.178-0.463-2.932-1.211L27.372,40.961l-10.1,10.1c-0.75,0.75-1.787,1.211-2.934,1.211 c-2.284,0-4.143-1.854-4.143-4.141c0-1.146,0.465-2.184,1.212-2.934l10.104-10.102L11.409,24.995 c-0.747-0.748-1.212-1.785-1.212-2.93c0-2.289,1.854-4.146,4.146-4.146c1.143,0,2.18,0.465,2.93,1.214l10.099,10.102l10.102-10.103 c0.754-0.749,1.787-1.214,2.934-1.214c2.289,0,4.146,1.856,4.146,4.145c0,1.146-0.467,2.18-1.217,2.932L33.233,35.1z" fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5"/> - <circle cx="27.371" cy="10.849" fill="&fill_color;" r="8.122" stroke="&stroke_color;" stroke-width="3.5"/> -</g></svg>
\ No newline at end of file diff --git a/icons/robot.svg b/icons/robot.svg deleted file mode 100644 index 91cedc8..0000000 --- a/icons/robot.svg +++ /dev/null @@ -1,99 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - version="1.0" - width="55" - height="55" - id="svg2"> - <metadata - id="metadata3038"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs4" /> - <rect - width="3.6656132" - height="9.5444069" - x="-42.845825" - y="-15.126163" - transform="matrix(-0.89091996,-0.45416035,-0.40870649,0.91266588,0,0)" - id="rect3687" - style="fill:none;stroke:#ffffff;stroke-width:1.72821403;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> - <rect - width="3.6656165" - height="9.5444155" - x="7.0011344" - y="9.6786585" - transform="matrix(0.89091996,-0.45416035,0.40870649,0.91266588,0,0)" - id="rect3685" - style="fill:none;stroke:#ffffff;stroke-width:1.72821581;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> - <rect - width="37.611328" - height="40.772209" - x="8.6943359" - y="9.8687277" - id="rect1919" - style="fill:#282828;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:2.46731305;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> - <path - d="m 25.841115,21.968429 a 6.4093275,6.355592 0 0 1 -12.818655,0 6.4093275,6.355592 0 1 1 12.818655,0 z" - id="path2794" - style="fill:none;stroke:#ffffff;stroke-width:1.48038781;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> - <path - d="m 42.429962,22.053175 a 6.4093275,6.355592 0 0 1 -12.818655,0 6.4093275,6.355592 0 1 1 12.818655,0 z" - id="path3669" - style="fill:none;stroke:#ffffff;stroke-width:1.48038781;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> - <rect - width="27.334038" - height="11.947053" - ry="0" - x="14.285403" - y="34.015823" - id="rect3679" - style="fill:none;stroke:#ffffff;stroke-width:1.91710222;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> - <path - d="m 20.86446,21.646627 a 1.2818655,1.3676591 0 0 1 -2.563731,0 1.2818655,1.3676591 0 1 1 2.563731,0 z" - id="path3681" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.48038781;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> - <path - d="m 37.754923,21.646627 a 1.2818655,1.3676591 0 0 1 -2.563731,0 1.2818655,1.3676591 0 1 1 2.563731,0 z" - id="path3683" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.48038781;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> - <path - d="m 14.228922,39.98935 26.843769,0" - id="path3689" - style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.91710222;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - <g - transform="translate(0.67863314,0)" - id="g3810"> - <path - d="m 29.963193,33.955559 0,11.263071" - id="path3691" - style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.91710222;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - <path - d="m 24.584384,33.955559 0,11.263071" - id="path3693" - style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.91710222;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - <path - d="m 35.342002,33.955559 0,11.263071" - id="path3695" - style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.91710222;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - <path - d="m 19.205576,33.955559 0,11.263071" - id="path3697" - style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.91710222;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - </g> -</svg> |