summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-09-12 01:24:43 +0200
committermathieui <mathieui@mathieui.net>2011-09-12 01:24:43 +0200
commitd24b3c42958f50c3979b37ab7666379d78b3fad1 (patch)
tree92f38367804f53d0f47f4997fea6ecb5891cd1c9
parenta20b42d2b4bf42fc9d6b9883439235fe43b7f533 (diff)
downloadpoezio-d24b3c42958f50c3979b37ab7666379d78b3fad1.tar.gz
poezio-d24b3c42958f50c3979b37ab7666379d78b3fad1.tar.bz2
poezio-d24b3c42958f50c3979b37ab7666379d78b3fad1.tar.xz
poezio-d24b3c42958f50c3979b37ab7666379d78b3fad1.zip
PGUP/PGDOWN on muc list (partially fixes #2165)
-rw-r--r--src/tabs.py6
-rw-r--r--src/windows.py22
2 files changed, 28 insertions, 0 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 37c5e888..0d1c5751 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1736,6 +1736,12 @@ class MucListTab(Tab):
def get_color_state(self):
return self._color_state
+ def on_scroll_up(self):
+ self.listview.scroll_up()
+
+ def on_scroll_down(self):
+ self.listview.scroll_down()
+
class SimpleTextTab(Tab):
"""
A very simple tab, with just a text displaying some
diff --git a/src/windows.py b/src/windows.py
index 89fb368c..4e464a75 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -1617,6 +1617,28 @@ class ListWin(Win):
self._starting_pos -= self.height // 2
return True
+ def scroll_down(self):
+ if not self.lines:
+ return
+ self._selected_row += self.height
+ if self._selected_row > len(self.lines) - 1:
+ self._selected_row = len(self.lines) -1
+ while self._selected_row >= self._starting_pos + self.height:
+ self._starting_pos += self.height // 2
+ if self._starting_pos < 0:
+ self._starting_pos = 0
+ return True
+
+ def scroll_up(self):
+ if not self.lines:
+ return
+ self._selected_row -= self.height + 1
+ if self._selected_row < 0:
+ self._selected_row = 0
+ while self._selected_row < self._starting_pos:
+ self._starting_pos -= self.height // 2
+ return True
+
class ColumnHeaderWin(Win):
"""
A class displaying the column's names