summaryrefslogtreecommitdiff
path: root/alot/widgets
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2018-06-24 17:07:05 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2018-07-24 22:05:57 +0100
commit2c3343397bb8ef4b866dc701492d338ff48965bd (patch)
treebc0720ff9bbc81d0f62c355f5cce0f83e4b0caa5 /alot/widgets
parent7d5120f85fafaf52884ed2549431f3f47294e760 (diff)
add text widget used in namedqueries buffers
Diffstat (limited to 'alot/widgets')
-rw-r--r--alot/widgets/namedqueries.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/alot/widgets/namedqueries.py b/alot/widgets/namedqueries.py
new file mode 100644
index 00000000..9791d5a3
--- /dev/null
+++ b/alot/widgets/namedqueries.py
@@ -0,0 +1,30 @@
+# Copyright (C) 2011-2018 Patrick Totzke <patricktotzke@gmail.com>
+# This file is released under the GNU GPL, version 3 or a later revision.
+# For further details see the COPYING file
+
+"""
+Widgets specific to Namedqueries mode
+"""
+import urwid
+
+
+class QuerylineWidget(urwid.Columns):
+ def __init__(self, key, value, count, count_unread):
+ self.query = key
+
+ count_widget = urwid.Text('{0:>7} {1:7}'.\
+ format(count, '({0})'.format(count_unread)))
+ key_widget = urwid.Text(key)
+ value_widget = urwid.Text(value)
+
+ urwid.Columns.__init__(self, (key_widget, count_widget, value_widget),
+ dividechars=1)
+
+ def selectable(self):
+ return True
+
+ def keypress(self, size, key):
+ return key
+
+ def get_query(self):
+ return self.query