Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/viewtoolbar.py
diff options
context:
space:
mode:
authorManuel Kaufmann <humitos@gmail.com>2012-04-29 15:45:22 (GMT)
committer Manuel QuiƱones <manuq@laptop.org>2012-09-10 18:50:45 (GMT)
commit02aa9d5b8890d47b23fa4150e1f33910d646a1c0 (patch)
tree27af5e61be9d388886db44fb98515f8d76515943 /viewtoolbar.py
parenta8d8738af9c3c1fdd3e692712fb46e6e1b1fb6be (diff)
Revert zoom with the original value SL #3540
New functionality to go back to the original zoom value. Added an icon next to zoom properties in View Toolbar. This function can be used with the hotkey "Control + 0" as well. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Acked-by: Manuel QuiƱones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
Diffstat (limited to 'viewtoolbar.py')
-rw-r--r--viewtoolbar.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/viewtoolbar.py b/viewtoolbar.py
index 0226df8..e7ad13e 100644
--- a/viewtoolbar.py
+++ b/viewtoolbar.py
@@ -23,6 +23,7 @@ from gi.repository import GObject
from sugar3.graphics.toolbutton import ToolButton
from browser import Browser
+from browser import ZOOM_ORIGINAL
class ViewToolbar(Gtk.Toolbar):
@@ -47,6 +48,12 @@ class ViewToolbar(Gtk.Toolbar):
self.insert(self.zoomin, -1)
self.zoomin.show()
+ self.zoom_original = ToolButton('zoom-original')
+ self.zoom_original.set_tooltip(_('Actual size'))
+ self.zoom_original.connect('clicked', self.__zoom_original_clicked_cb)
+ self.insert(self.zoom_original, -1)
+ self.zoom_original.show()
+
self.separator = Gtk.SeparatorToolItem()
self.separator.set_draw(True)
self.insert(self.separator, -1)
@@ -83,6 +90,10 @@ class ViewToolbar(Gtk.Toolbar):
self.zoomin.set_sensitive(is_webkit_browser)
self.zoomout.set_sensitive(is_webkit_browser)
+ def __zoom_original_clicked_cb(self, button):
+ tabbed_view = self._activity.get_canvas()
+ tabbed_view.props.current_browser.set_zoom_level(ZOOM_ORIGINAL)
+
def __zoomin_clicked_cb(self, button):
tabbed_view = self._activity.get_canvas()
tabbed_view.props.current_browser.zoom_in()