2011/6/4 Gonzalo Odiard <span dir="ltr"><<a href="mailto:gonzalo@laptop.org">gonzalo@laptop.org</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

May be this can be a good addition to Chat, Infoslicer, Pippy and Words ;)<br><font color="#888888"><br></font></blockquote><div>+1, we can work on adding this feature to those  activities as well. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<font color="#888888">Gonzalo</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">2011/6/3 Manuel Quiñones <span dir="ltr"><<a href="mailto:manuel.por.aca@gmail.com" target="_blank">manuel.por.aca@gmail.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">---<br>
 terminal.py |   31 ++++++++++++++++++++++++++++++-<br>
 1 files changed, 30 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/terminal.py b/terminal.py<br>
index f54da21..eef93d6 100644<br>
--- a/terminal.py<br>
+++ b/terminal.py<br>
@@ -45,6 +45,8 @@ log = logging.getLogger('Terminal')<br>
 log.setLevel(logging.DEBUG)<br>
 logging.basicConfig()<br>
<br>
+ZOOM_STEP = 2000<br>
+<br>
<br>
 class TerminalActivity(activity.Activity):<br>
<br>
@@ -139,6 +141,21 @@ class TerminalActivity(activity.Activity):<br>
<br>
     def _create_view_toolbar(self):<br>
         view_toolbar = gtk.Toolbar()<br>
+<br>
+        zoom_out_button = ToolButton('zoom-out')<br>
+        zoom_out_button.set_tooltip(_('Zoom out'))<br>
+        zoom_out_button.props.accelerator = '<Ctrl>-'<br>
+        zoom_out_button.connect('clicked', self.__zoom_out_cb)<br>
+        view_toolbar.insert(zoom_out_button, -1)<br>
+        zoom_out_button.show()<br>
+<br>
+        zoom_in_button = ToolButton('zoom-in')<br>
+        zoom_in_button.set_tooltip(_('Zoom in'))<br>
+        zoom_in_button.props.accelerator = '<Ctrl>+'<br>
+        zoom_in_button.connect('clicked', self.__zoom_in_cb)<br>
+        view_toolbar.insert(zoom_in_button, -1)<br>
+        zoom_in_button.show()<br>
+<br>
         fullscreen_button = ToolButton('view-fullscreen')<br>
         fullscreen_button.set_tooltip(_("Fullscreen"))<br>
         fullscreen_button.props.accelerator = '<Alt>Return'<br>
@@ -147,6 +164,19 @@ class TerminalActivity(activity.Activity):<br>
         fullscreen_button.show()<br>
         return view_toolbar<br>
<br>
+    def _zoom(self, step):<br>
+        current_page = self._notebook.get_current_page()<br>
+        vt = self._notebook.get_nth_page(current_page).vt<br>
+        font_desc = vt.get_font()<br>
+        font_desc.set_size(font_desc.get_size() + step)<br>
+        vt.set_font(font_desc)<br>
+<br>
+    def __zoom_out_cb(self, button):<br>
+        self._zoom(ZOOM_STEP * -1)<br>
+<br>
+    def __zoom_in_cb(self, button):<br>
+        self._zoom(ZOOM_STEP)<br>
+<br>
     def __fullscreen_cb(self, button):<br>
         self.fullscreen()<br>
<br>
@@ -425,7 +455,6 @@ class TerminalActivity(activity.Activity):<br>
<br>
         font = self._get_conf(conf, 'font', 'Monospace')<br>
         vt.set_font(pango.FontDescription(font))<br>
-<br>
         fg_color = self._get_conf(conf, 'fg_color', '#000000')<br>
         bg_color = self._get_conf(conf, 'bg_color', '#FFFFFF')<br>
         vt.set_colors(gtk.gdk.color_parse(fg_color),<br>
<font color="#888888">--<br>
1.7.4.4<br>
<br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</font></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></blockquote></div><br>