Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)