Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/toolbar.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-05-02 12:59:24 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-05-02 12:59:24 (GMT)
commitad7d1ad4ca4c9ab9460f59acc6e5cc2606970f45 (patch)
tree8ff200b8f21078ad27111de3365a71b5cfd412b0 /toolbar.py
parentb5d73e8fd2584e51954ba5d722b3907461c5dee9 (diff)
Add a button to zoom to width
Our users use the screen more than paper, zoom to width should be the more useful zoom value. Use the same icon a position as in Read. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'toolbar.py')
-rw-r--r--toolbar.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/toolbar.py b/toolbar.py
index 4af47ff..49c15be 100644
--- a/toolbar.py
+++ b/toolbar.py
@@ -299,6 +299,12 @@ class ViewToolbar(gtk.Toolbar):
self.insert(self._zoom_in, -1)
self._zoom_in.show()
+ self._zoom_to_width = ToolButton('zoom-best-fit')
+ self._zoom_to_width.set_tooltip(_('Zoom to width'))
+ self._zoom_to_width.connect('clicked', self._zoom_to_width_cb)
+ self.insert(self._zoom_to_width, -1)
+ self._zoom_to_width.show()
+
# TODO: fix the initial value
self._zoom_spin_adj = gtk.Adjustment(0, 25, 400, 25, 50, 0)
self._zoom_spin = gtk.SpinButton(self._zoom_spin_adj, 0, 0)
@@ -375,6 +381,10 @@ class ViewToolbar(gtk.Toolbar):
if self._zoom_percentage <= 375:
self.set_zoom_percentage(self._zoom_percentage + 25)
+ def _zoom_to_width_cb(self, button):
+ self._abiword_canvas.zoom_width()
+ self._zoom_percentage = self._abiword_canvas.get_zoom_percentage()
+
def _zoom_spin_cb(self, button):
self._zoom_percentage = self._zoom_spin.get_value_as_int()
self._abiword_canvas.set_zoom_percentage(self._zoom_percentage)