Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Maurer <uwog@uwog.net>2007-09-02 20:49:59 (GMT)
committer Marc Maurer <uwog@uwog.net>2007-09-02 20:49:59 (GMT)
commit12aead0ad4ee16a6210086e143da65794d8ab5ff (patch)
tree70eb166e5adfedd000439abed2561fda2386c5a8
parentbdbbaa8a3ad17b65f96e0fb43f492a1a4c33db29 (diff)
Hook up the abiword canvas 'style-name' signal to the Format toolbar
-rw-r--r--NEWS5
-rw-r--r--toolbar.py11
2 files changed, 14 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index c414f50..1e42e70 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,9 @@
-* Hook up the abiword canvas 'font-family' signal to the Write toolbar (uwog)
+* Hook up the abiword canvas 'style-name' signal to the Format toolbar (uwog)
+* Hook up the abiword canvas 'font-family' signal to the Text toolbar (uwog)
* Add a format-text-size icon before the text size selection dropdown (uwog)
* Don't forget to actually show the separators in the Text toolbar (uwog)
* Add a Style label before the Style combobox (uwog)
-* Hook up the abiword canvas 'font-size' signal to the Write toolbar (uwog)
+* Hook up the abiword canvas 'font-size' signal to the Text toolbar (uwog)
36
diff --git a/toolbar.py b/toolbar.py
index 2563ad1..89d1260 100644
--- a/toolbar.py
+++ b/toolbar.py
@@ -381,6 +381,17 @@ class FormatToolbar(gtk.Toolbar):
self.insert(tool_item, -1);
tool_item.show()
+ self._abiword_canvas.connect('style-name', self._style_cb)
+
+ def _style_cb(self, abi, style_name):
+ for i, s in enumerate(self._styles):
+ if s[0] == style_name:
+ self._style_combo.handler_block(self._style_changed_id)
+ self._style_combo.set_active(i)
+ self._style_combo.handler_unblock(self._style_changed_id)
+ break;
+ # TODO: if no match is found, then add the style to the style dropdown
+
def _style_changed_cb(self, combobox):
if self._style_combo.get_active() != -1:
logger.debug('Setting style name: %s', self._styles[self._style_combo.get_active()][0])