diff options
author | James Simmons <jim@simmons.olpc> | 2009-07-17 00:29:35 (GMT) |
---|---|---|
committer | James Simmons <jim@simmons.olpc> | 2009-07-17 00:29:35 (GMT) |
commit | 818581b3779ba371cc598543c6c47ef5df09c20f (patch) | |
tree | 11ec635df4ad7e56297d58a1d2596e92e2862316 /readtoolbar.py | |
parent | f49a6383c49b119807c4c5fea8f9588155c1330c (diff) |
modified: readtoolbar.py
Add underline button to the toolbar.
Diffstat (limited to 'readtoolbar.py')
-rw-r--r-- | readtoolbar.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/readtoolbar.py b/readtoolbar.py index ef57a64..9f99e10 100644 --- a/readtoolbar.py +++ b/readtoolbar.py @@ -119,6 +119,14 @@ class ReadToolbar(gtk.Toolbar): self.insert(bookmarkitem, -1) bookmarkitem.show_all() + underline_item = gtk.ToolItem() + self._underline = ToggleToolButton('format-text-underline') + self._underline.set_tooltip(_('Underline')) + self._underline_id = self._underline.connect('clicked', self._underline_cb) + underline_item.add(self._underline) + self.insert(underline_item, -1) + underline_item.show_all() + def _num_page_entry_insert_text_cb(self, entry, text, length, position): if not re.match('[0-9]', text): entry.emit_stop_by_name('insert-text') @@ -177,6 +185,14 @@ class ReadToolbar(gtk.Toolbar): def _bookmarker_clicked_cb(self, button): self.activity.bookmarker_clicked(button) + def _underline_cb(self, button): + self.activity.underline_clicked() + + def setToggleButtonState(self,button,b,id): + button.handler_block(id) + button.set_active(b) + button.handler_unblock(id) + class ViewToolbar(gtk.Toolbar): __gtype_name__ = 'ViewToolbar' |