Hi Gary,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Make your changes, commit, push, and then request a merge?<br>
<br></blockquote><div><br></div><div>I have filed the merge request.Please look into it. Also I made it backward compatible to previous sugar versions as you suggested. It would fall back to older toolbar design in case of previous sugar versions.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Having a quick scan through the below patch I don&#39;t see any fallback to the old toolbar setup if someone is running an older version of Sugar. I don&#39;t want to loose compatibility 99% of our current user base if at all possible (check the git reps of Moon, Calculator, TurtleArt, and I&#39;m sure many other activities for dual toolbar support).<br>

<br>
Thanks again for taking the time to submit a patch.<br>
<br>
Kind Regards,<br>
<font color="#888888">--Gary<br>
</font><div><div></div><div class="h5"><br>
&gt; Signed-off-by: akashg1611 &lt;<a href="mailto:akashg1611@gmail.com">akashg1611@gmail.com</a>&gt;<br>
&gt; ---<br>
&gt; activity.py              |   77 ++++++++++++++++++++++++++-------------------<br>
&gt; icons/toolbar-create.svg |   44 ++++++++++++++++++++++++++<br>
&gt; 2 files changed, 88 insertions(+), 33 deletions(-)<br>
&gt; create mode 100644 icons/toolbar-create.svg<br>
&gt;<br>
&gt; diff --git a/activity.py b/activity.py<br>
&gt; index 273a001..ca18aad 100644<br>
&gt; --- a/activity.py<br>
&gt; +++ b/activity.py<br>
&gt; @@ -21,6 +21,10 @@ import olpcgames<br>
&gt; import pygame<br>
&gt; from sugar.graphics.radiotoolbutton import RadioToolButton<br>
&gt; from sugar.graphics.toolbutton import ToolButton<br>
&gt; +from sugar.graphics.toolbarbox import ToolbarBox<br>
&gt; +from sugar.graphics.toolbarbox import ToolbarButton<br>
&gt; +from sugar.activity.widgets import ActivityToolbarButton<br>
&gt; +from sugar.activity.widgets import StopButton<br>
&gt; from sugar.activity import activity<br>
&gt; from gettext import gettext as _<br>
&gt; import gtk<br>
&gt; @@ -34,6 +38,44 @@ class PhysicsActivity(olpcgames.PyGameActivity):<br>
&gt;         super(PhysicsActivity, self).__init__(handle)<br>
&gt;         self.metadata[&#39;mime_type&#39;] = &#39;application/x-physics-activity&#39;<br>
&gt;<br>
&gt; +        toolbar_box = ToolbarBox()<br>
&gt; +<br>
&gt; +        activity_button = ActivityToolbarButton(self)<br>
&gt; +        toolbar_box.toolbar.insert(activity_button, 0)<br>
&gt; +        activity_button.page.keep.props.accelerator = &#39;&lt;Ctrl&gt;&lt;Shift&gt;S&#39;<br>
&gt; +        activity_button.show()<br>
&gt; +<br>
&gt; +        create_toolbar = self._create_create_toolbar()<br>
&gt; +        create_toolbar_button = ToolbarButton(<br>
&gt; +                page=create_toolbar,<br>
&gt; +                icon_name=&#39;toolbar-create&#39;)<br>
&gt; +        create_toolbar.show()<br>
&gt; +        toolbar_box.toolbar.insert(create_toolbar_button, -1)<br>
&gt; +        create_toolbar_button.show()<br>
&gt; +<br>
&gt; +     stop_play = ToolButton(&#39;media-playback-stop&#39;)<br>
&gt; +     stop_play_state = True<br>
&gt; +        stop_play.set_tooltip(_(&quot;Stop&quot;))<br>
&gt; +        stop_play.set_accelerator(_(&#39;&lt;ctrl&gt;space&#39;))<br>
&gt; +        stop_play.connect(&#39;clicked&#39;, self.stop_play_cb)<br>
&gt; +     toolbar_box.toolbar.insert(stop_play, -1)<br>
&gt; +        stop_play.show()<br>
&gt; +<br>
&gt; +        separator = gtk.SeparatorToolItem()<br>
&gt; +        separator.props.draw = False<br>
&gt; +        separator.set_expand(True)<br>
&gt; +        toolbar_box.toolbar.insert(separator, -1)<br>
&gt; +        separator.show()<br>
&gt; +<br>
&gt; +     stop_button = StopButton(self)<br>
&gt; +        stop_button.props.accelerator = &#39;&lt;Ctrl&gt;&lt;Shift&gt;Q&#39;<br>
&gt; +        toolbar_box.toolbar.insert(stop_button, -1)<br>
&gt; +        stop_button.show()<br>
&gt; +<br>
&gt; +     self.set_toolbar_box(toolbar_box)<br>
&gt; +        toolbar_box.show()<br>
&gt; +<br>
&gt; +<br>
&gt;     def write_file(self, file_path):<br>
&gt;         &quot;&quot;&quot;Over-ride olpcgames write_file so that title keeps working.<br>
&gt;         &quot;&quot;&quot;<br>
&gt; @@ -46,31 +88,8 @@ class PhysicsActivity(olpcgames.PyGameActivity):<br>
&gt;         event.block()<br>
&gt;         event.retire() # &lt;- without this, title editing stops updating<br>
&gt;<br>
&gt; -    # setup the toolbar<br>
&gt; -    def build_toolbar(self):<br>
&gt; -        # make a toolbox<br>
&gt; -        toolbox = activity.ActivityToolbox(self)<br>
&gt; -<br>
&gt; -        # modify the Activity tab<br>
&gt; -        activity_toolbar = toolbox.get_activity_toolbar()<br>
&gt; -        activity_toolbar.share.props.visible = False<br>
&gt; -        self.blocklist = []<br>
&gt; -        # make a &#39;create&#39; toolbar<br>
&gt; +    def _create_create_toolbar(self):<br>
&gt;         create_toolbar = gtk.Toolbar()<br>
&gt; -<br>
&gt; -        # stop/play button<br>
&gt; -        self.stop_play_state = True<br>
&gt; -        self.stop_play = ToolButton(&#39;media-playback-stop&#39;)<br>
&gt; -        self.stop_play.set_tooltip(_(&quot;Stop&quot;))<br>
&gt; -        self.stop_play.set_accelerator(_(&#39;&lt;ctrl&gt;space&#39;))<br>
&gt; -        self.stop_play.connect(&#39;clicked&#39;, self.stop_play_cb)<br>
&gt; -        create_toolbar.insert(self.stop_play, 0)<br>
&gt; -        self.stop_play.show()<br>
&gt; -<br>
&gt; -        separator = gtk.SeparatorToolItem()<br>
&gt; -        create_toolbar.insert(separator, 1)<br>
&gt; -        separator.show()<br>
&gt; -<br>
&gt;         # make + add the component buttons<br>
&gt;         self.radioList = {}<br>
&gt;         firstButton = None<br>
&gt; @@ -87,15 +106,7 @@ class PhysicsActivity(olpcgames.PyGameActivity):<br>
&gt;             create_toolbar.insert(button,-1)<br>
&gt;             button.show()<br>
&gt;             self.radioList[button] = <a href="http://c.name" target="_blank">c.name</a><br>
&gt; -<br>
&gt; -        # add the toolbars to the toolbox<br>
&gt; -        toolbox.add_toolbar(_(&quot;Create&quot;),create_toolbar)<br>
&gt; -        create_toolbar.show()<br>
&gt; -<br>
&gt; -        toolbox.show()<br>
&gt; -        self.set_toolbox(toolbox)<br>
&gt; -        toolbox.set_current_toolbar(1)<br>
&gt; -        return activity_toolbar<br>
&gt; +     return create_toolbar<br>
&gt;<br>
&gt;     def stop_play_cb(self, button):<br>
&gt;         pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action=&quot;stop_start_toggle&quot;))<br>
&gt; diff --git a/icons/toolbar-create.svg b/icons/toolbar-create.svg<br>
&gt; new file mode 100644<br>
&gt; index 0000000..ea7c0ce<br>
&gt; --- /dev/null<br>
&gt; +++ b/icons/toolbar-create.svg<br>
&gt; @@ -0,0 +1,44 @@<br>
&gt; +&lt;?xml version=&quot;1.0&quot; ?&gt;&lt;!-- Created with Inkscape (<a href="http://www.inkscape.org/" target="_blank">http://www.inkscape.org/</a>) --&gt;&lt;!DOCTYPE svg  PUBLIC &#39;-//W3C//DTD SVG 1.1//EN&#39;  &#39;<a href="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" target="_blank">http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd</a>&#39; [<br>

&gt; +     &lt;!ENTITY stroke_color &quot;none&quot;&gt;<br>
&gt; +     &lt;!ENTITY fill_color &quot;#ffffff&quot;&gt;<br>
&gt; +]&gt;&lt;svg height=&quot;48pt&quot; id=&quot;svg1&quot; inkscape:version=&quot;0.47 r22583&quot; sodipodi:docname=&quot;toolbar-create.svg&quot; sodipodi:version=&quot;0.32&quot; style=&quot;&quot; version=&quot;1.0&quot; width=&quot;48pt&quot; x=&quot;0&quot; xmlns=&quot;<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>&quot; xmlns:cc=&quot;<a href="http://creativecommons.org/ns#" target="_blank">http://creativecommons.org/ns#</a>&quot; xmlns:dc=&quot;<a href="http://purl.org/dc/elements/1.1/" target="_blank">http://purl.org/dc/elements/1.1/</a>&quot; xmlns:inkscape=&quot;<a href="http://www.inkscape.org/namespaces/inkscape" target="_blank">http://www.inkscape.org/namespaces/inkscape</a>&quot; xmlns:rdf=&quot;<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#" target="_blank">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a>&quot; xmlns:sodipodi=&quot;<a href="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" target="_blank">http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd</a>&quot; xmlns:svg=&quot;<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>&quot; xmlns:xlink=&quot;<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot; y=&quot;0&quot;&gt;<br>

&gt; +  &lt;metadata id=&quot;metadata2985&quot; style=&quot;&quot;&gt;<br>
&gt; +    &lt;rdf:RDF style=&quot;&quot;&gt;<br>
&gt; +      &lt;cc:Work rdf:about=&quot;&quot; style=&quot;&quot;&gt;<br>
&gt; +        &lt;dc:format style=&quot;&quot;&gt;image/svg+xml&lt;/dc:format&gt;<br>
&gt; +        &lt;dc:type rdf:resource=&quot;<a href="http://purl.org/dc/dcmitype/StillImage" target="_blank">http://purl.org/dc/dcmitype/StillImage</a>&quot; style=&quot;&quot;/&gt;<br>
&gt; +        &lt;dc:title style=&quot;&quot;/&gt;<br>
&gt; +      &lt;/cc:Work&gt;<br>
&gt; +    &lt;/rdf:RDF&gt;<br>
&gt; +  &lt;/metadata&gt;<br>
&gt; +  &lt;sodipodi:namedview bordercolor=&quot;#666666&quot; borderopacity=&quot;1.0&quot; horizgrid=&quot;false&quot; id=&quot;base&quot; inkscape:current-layer=&quot;svg1&quot; inkscape:cx=&quot;-10.626905&quot; inkscape:cy=&quot;21.859944&quot; inkscape:pageopacity=&quot;0.0&quot; inkscape:pageshadow=&quot;2&quot; inkscape:window-height=&quot;825&quot; inkscape:window-maximized=&quot;1&quot; inkscape:window-width=&quot;1440&quot; inkscape:window-x=&quot;0&quot; inkscape:window-y=&quot;24&quot; inkscape:zoom=&quot;4.9119411&quot; pagecolor=&quot;#ffffff&quot; showgrid=&quot;false&quot; snaptogrid=&quot;false&quot; snaptoguides=&quot;false&quot; style=&quot;&quot; vertgrid=&quot;false&quot;/&gt;<br>

&gt; +  &lt;defs id=&quot;defs3&quot; style=&quot;&quot;&gt;<br>
&gt; +    &lt;inkscape:perspective id=&quot;perspective2987&quot; inkscape:persp3d-origin=&quot;30 : 20 : 1&quot; inkscape:vp_x=&quot;0 : 30 : 1&quot; inkscape:vp_y=&quot;0 : 1000 : 0&quot; inkscape:vp_z=&quot;60 : 30 : 1&quot; sodipodi:type=&quot;inkscape:persp3d&quot; style=&quot;&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient570&quot; style=&quot;&quot;&gt;<br>
&gt; +      &lt;stop id=&quot;stop571&quot; offset=&quot;0&quot; style=&quot;stop-color:#ffffff;stop-opacity:1;&quot;/&gt;<br>
&gt; +      &lt;stop id=&quot;stop572&quot; offset=&quot;1&quot; style=&quot;stop-color:#ffffff;stop-opacity:0;&quot;/&gt;<br>
&gt; +    &lt;/linearGradient&gt;<br>
&gt; +    &lt;linearGradient id=&quot;linearGradient563&quot; style=&quot;&quot;&gt;<br>
&gt; +      &lt;stop id=&quot;stop564&quot; offset=&quot;0.00000000&quot; style=&quot;stop-color:#666666;stop-opacity:1;&quot;/&gt;<br>
&gt; +      &lt;stop id=&quot;stop565&quot; offset=&quot;1.00000000&quot; style=&quot;stop-color:#666666;stop-opacity:1;&quot;/&gt;<br>
&gt; +    &lt;/linearGradient&gt;<br>
&gt; +    &lt;linearGradient gradientTransform=&quot;matrix(1.04498,0,0,0.9569561,-74.308708,-2.6466114)&quot; gradientUnits=&quot;userSpaceOnUse&quot; id=&quot;linearGradient566&quot; style=&quot;&quot; x1=&quot;23.402853&quot; x2=&quot;35.835532&quot; xlink:href=&quot;#linearGradient563&quot; y1=&quot;23.747154&quot; y2=&quot;36.390283&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient569&quot; style=&quot;&quot; x1=&quot;0.009905&quot; x2=&quot;0.985224&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;0.007809&quot; y2=&quot;1.015625&quot;/&gt;<br>

&gt; +    &lt;linearGradient gradientTransform=&quot;scale(0.999995,1.000005)&quot; id=&quot;linearGradient573&quot; style=&quot;&quot; x1=&quot;0.015742&quot; x2=&quot;0.976382&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;0.015626&quot; y2=&quot;0.999995&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient575&quot; style=&quot;&quot; x1=&quot;0.006623&quot; x2=&quot;0.973510&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;0.007813&quot; y2=&quot;0.984375&quot;/&gt;<br>

&gt; +    &lt;linearGradient gradientTransform=&quot;scale(1.2487241,0.80081741)&quot; gradientUnits=&quot;userSpaceOnUse&quot; id=&quot;linearGradient578&quot; style=&quot;&quot; x1=&quot;4.5679298&quot; x2=&quot;11.042724&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;46.001992&quot; y2=&quot;52.375657&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient583&quot; style=&quot;&quot; x1=&quot;0.012999&quot; x2=&quot;1.012987&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;0.015680&quot; y2=&quot;1.000001&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient637&quot; style=&quot;&quot; x1=&quot;0.07954545&quot; x2=&quot;0.95454544&quot; xlink:href=&quot;#linearGradient563&quot; y1=&quot;0.06250000&quot; y2=&quot;0.97656250&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient640&quot; style=&quot;&quot; x1=&quot;0.03225806&quot; x2=&quot;0.99596775&quot; xlink:href=&quot;#linearGradient563&quot; y1=&quot;0.05468750&quot; y2=&quot;1.00000000&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient645&quot; style=&quot;&quot; x1=&quot;0.010877&quot; x2=&quot;0.989090&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;0.038449&quot; y2=&quot;0.987177&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient646&quot; style=&quot;&quot; x1=&quot;0.056578&quot; x2=&quot;0.867923&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;0.023450&quot; y2=&quot;0.976563&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient647&quot; style=&quot;&quot; x1=&quot;0.000007&quot; x2=&quot;0.951807&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;0.000000&quot; y2=&quot;0.984375&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient675&quot; style=&quot;&quot; x1=&quot;0.056605&quot; x2=&quot;0.943396&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;0.015625&quot; y2=&quot;0.984375&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient676&quot; style=&quot;&quot; x1=&quot;0.011765&quot; x2=&quot;1.011765&quot; xlink:href=&quot;#linearGradient570&quot; y1=&quot;-0.000000&quot; y2=&quot;1.015625&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient684&quot; style=&quot;&quot; x1=&quot;0.09210526&quot; x2=&quot;0.93421054&quot; xlink:href=&quot;#linearGradient563&quot; y1=&quot;0.12500000&quot; y2=&quot;0.92187500&quot;/&gt;<br>

&gt; +    &lt;linearGradient id=&quot;linearGradient685&quot; style=&quot;&quot; x1=&quot;0.06603774&quot; x2=&quot;0.94339621&quot; xlink:href=&quot;#linearGradient563&quot; y1=&quot;0.07812500&quot; y2=&quot;0.95312500&quot;/&gt;<br>

&gt; +  &lt;/defs&gt;<br>
&gt; +  &lt;path d=&quot;m 1.6714541,46.028933 c 2.5395548,1.861985 4.9782017,-5.378683 9.5887409,1.564511 5.202194,7.839595 -2.2748278,8.004289 -1.5908585,11.218364 0.5434475,2.15168 7.8018915,0.78452 9.4836775,-1.356607 1.708234,-2.174518 -1.328528,-8.961765 0.686245,-11.589945 6.679753,-8.71269 16.362463,-17.130631 25.397539,-22.432085 2.941573,-1.725842 8.191049,3.04221 10.532509,1.349931 2.272038,-1.642373 4.894662,-10.122847 3.307654,-11.353779 C 56.639324,11.47279 52.997644,20.80289 48.606866,13.989506 44.186925,7.129412<br>

&gt; +       52.142642,4.5631634 51.662085,1.862198 51.217131,-0.33348689 43.318205,0.8930759 41.301114,3.1327101 39.311696,5.3415778 39.98847,13.033259 37.810293,15.81846 31.052456,24.45924 23.378731,32.160168 14.492957,37.410639 11.915703,38.933488 7.3485542,34.119614 5.2533614,35.52793 3.0747599,36.992339 0.03942982,44.719057 1.6714541,46.028933 z&quot; id=&quot;path636&quot; sodipodi:nodetypes=&quot;cccsssscscssssc&quot; style=&quot;font-size:12px;opacity:1.0;fill:&amp;fill_color;;fill-rule:evenodd;stroke-width:12.5&quot;/&gt;<br>

&gt; +  &lt;path d=&quot;m 36.034635,17.45063 -4.701433,-2.805627 -4.976523,2.282375 1.215487,-5.338314 -3.708498,-4.0276614 5.452645,-0.4936332 2.684545,-4.7716069 2.154433,5.0332324 5.367638,1.0786459 -4.121133,3.6043422 0.632839,5.438247 z&quot; id=&quot;path3942&quot; inkscape:flatsided=&quot;false&quot; inkscape:randomized=&quot;0&quot; inkscape:rounded=&quot;0&quot; sodipodi:arg1=&quot;0.9964915&quot; sodipodi:arg2=&quot;1.62481&quot; sodipodi:cx=&quot;31.555754&quot; sodipodi:cy=&quot;10.528723&quot; sodipodi:r1=&quot;8.2445841&quot; sodipodi:r2=&quot;4.122292&quot; sodipodi:sides=&quot;5&quot; sodipodi:type=&quot;star&quot; style=&quot;opacity:1.0;fill:&amp;fill_color;;fill-opacity:1.0&quot; transform=&quot;matrix(1.7410551,0,0,1.8060416,-29.492251,-3.6830718)&quot;/&gt;<br>

&gt; +&lt;/svg&gt;<br>
&gt; --<br>
&gt; 1.7.0.4<br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best Regards<br>Akash Gangil<br><br>