summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2013-02-23 11:59:34 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2013-03-03 13:48:21 +0000
commit0859a960f620e7df879c7bbf92d51fd15b606b44 (patch)
treef547ff3df0370dc4fd0bab36a604e28af49ea4a1 /alot
parent6e09f49a8fb6e252376bb248ed6b5928c00079b9 (diff)
add Buffer.focus_first, to move focus to first entry
cf issue #532
Diffstat (limited to 'alot')
-rw-r--r--alot/buffers.py12
m---------alot/foreign/urwidtrees0
2 files changed, 12 insertions, 0 deletions
diff --git a/alot/buffers.py b/alot/buffers.py
index 6d0264ea..0c5d09a6 100644
--- a/alot/buffers.py
+++ b/alot/buffers.py
@@ -110,6 +110,9 @@ class BufferlistBuffer(Buffer):
bufferlinewidget = linewidget.get_focus().original_widget
return bufferlinewidget.get_buffer()
+ def focus_first(self):
+ self.body.set_focus(0)
+
class EnvelopeBuffer(Buffer):
"""message composition mode"""
@@ -285,6 +288,9 @@ class SearchBuffer(Buffer):
thread = threadlinewidget.get_thread()
return thread
+ def focus_first(self):
+ self.body.set_focus(0)
+
class ThreadBuffer(Buffer):
"""displays a thread as a tree of messages"""
@@ -361,6 +367,9 @@ class ThreadBuffer(Buffer):
def get_focus(self):
return self.body.get_focus()
+ def focus_first(self):
+ self.body.set_focus(self._nested_tree.root)
+
def expand(self, msgpos):
MT = self._tree[msgpos]
MT.expand(MT.root)
@@ -458,6 +467,9 @@ class TagListBuffer(Buffer):
self.taglist.set_focus(focusposition % len(displayedtags))
+ def focus_first(self):
+ self.body.set_focus(0)
+
def get_selected_tag(self):
"""returns selected tagstring"""
(cols, pos) = self.taglist.get_focus()
diff --git a/alot/foreign/urwidtrees b/alot/foreign/urwidtrees
-Subproject f4e9bde0557a848867e6898a65c084f49b21ea4
+Subproject 82ed86061b9d9a4f82452676875adb50aa5f125