diff options
author | Marc Maurer <uwog@uwog.net> | 2007-09-02 20:49:59 (GMT) |
---|---|---|
committer | Marc Maurer <uwog@uwog.net> | 2007-09-02 20:49:59 (GMT) |
commit | 12aead0ad4ee16a6210086e143da65794d8ab5ff (patch) | |
tree | 70eb166e5adfedd000439abed2561fda2386c5a8 | |
parent | bdbbaa8a3ad17b65f96e0fb43f492a1a4c33db29 (diff) |
Hook up the abiword canvas 'style-name' signal to the Format toolbar
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | toolbar.py | 11 |
2 files changed, 14 insertions, 2 deletions
@@ -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 @@ -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]) |