diff options
author | James Simmons <jim@olpc.simmons> | 2009-05-23 14:41:11 (GMT) |
---|---|---|
committer | James Simmons <jim@olpc.simmons> | 2009-05-23 14:41:11 (GMT) |
commit | f29387cd8da3b31e83e84514e90d797166dd1d39 (patch) | |
tree | 362fb523dcdc7eef3e32d4c80a4630df8b038740 /readtoolbar.py | |
parent | dbe59f9949eb84404d43e74f86fcd52610fae284 (diff) |
modified: ReadEtextsActivity.py
modified: readtoolbar.py
Polish up the book searching code.
Diffstat (limited to 'readtoolbar.py')
-rw-r--r-- | readtoolbar.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/readtoolbar.py b/readtoolbar.py index 3eee778..77bd54d 100644 --- a/readtoolbar.py +++ b/readtoolbar.py @@ -266,12 +266,14 @@ class BooksToolbar(gtk.Toolbar): self._search_entry = gtk.Entry() self._search_entry.connect('activate', self._search_entry_activate_cb) + self._search_entry.connect("key_press_event", self.keypress_cb) width = int(gtk.gdk.screen_width() / 2) self._search_entry.set_size_request(width, -1) book_search_item.add(self._search_entry) self._search_entry.show() + self._search_entry.grab_focus() self.insert(book_search_item, -1) book_search_item.show() @@ -295,6 +297,12 @@ class BooksToolbar(gtk.Toolbar): def _enable_button(self, state): self._download.props.sensitive = state + def keypress_cb(self, widget, event): + keyname = gtk.gdk.keyval_name(event.keyval) + if keyname == 'Escape': + self.activity.list_scroller.hide() + return True + class SpeechToolbar(gtk.Toolbar): def __init__(self): gtk.Toolbar.__init__(self) |