Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AbiWordActivity.py6
-rw-r--r--NEWS2
-rw-r--r--toolbar.py14
3 files changed, 15 insertions, 7 deletions
diff --git a/AbiWordActivity.py b/AbiWordActivity.py
index a21a4bc..ab4ee3b 100644
--- a/AbiWordActivity.py
+++ b/AbiWordActivity.py
@@ -95,12 +95,16 @@ class AbiWordActivity (Activity):
def _map_cb(self, activity):
logger.debug('_map_cb')
-
+
# always make sure at least 1 document is loaded (bad bad widget design)
if not self._file_opened:
logger.debug("Loading empty doc")
self.abiword_canvas.load_file('', '');
+ # set the initial zoom to page width; note: always do this AFTER a document
+ # has been opened
+ self.abiword_canvas.zoom_width()
+
# activity sharing
pservice = presenceservice.get_instance()
diff --git a/NEWS b/NEWS
index bd8d343..9810aa0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+* Connect to the zoom signal to show the currect zoom level (uwog)
+
29
* Use a logger for the toolbar (uwog)
diff --git a/toolbar.py b/toolbar.py
index bc49460..ce65ab7 100644
--- a/toolbar.py
+++ b/toolbar.py
@@ -299,9 +299,6 @@ class ViewToolbar(gtk.Toolbar):
gtk.Toolbar.__init__(self)
self._abiword_canvas = abiword_canvas
-
- # we can't use abiword_canvas.get_zoom_percentage() yet, as the frame is
- # not fully initialized
self._zoom_percentage = 0;
self._zoom_in = ToolButton('stock-zoom-in')
@@ -363,13 +360,18 @@ class ViewToolbar(gtk.Toolbar):
self._abiword_canvas.connect("page-count", self._page_count_cb)
self._abiword_canvas.connect("current-page", self._current_page_cb)
+ self._abiword_canvas.connect("zoom", self._zoom_cb)
def set_zoom_percentage(self, zoom):
self._zoom_percentage = zoom
- #print 'new zoom percentage:',self._zoom_percentage
self._abiword_canvas.set_zoom_percentage(self._zoom_percentage)
- # update out spinner TODO: should be handled by a callback from the abicanvas
- self._zoom_spin.set_value(zoom)
+
+ def _zoom_cb(self, canvas, zoom):
+ self._zoom_spin.handler_block(self._zoom_spin_id)
+ try:
+ self._zoom_spin.set_value(zoom)
+ finally:
+ self._zoom_spin.handler_unblock(self._zoom_spin_id)
def _zoom_in_cb(self, button):
if self._zoom_percentage == 0: