summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 492a4412..f9032b6e 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -302,13 +302,25 @@ class Tab(object):
def on_scroll_down(self):
"""
- Defines what happens when we scrol down
+ Defines what happens when we scroll down
"""
pass
def on_scroll_up(self):
"""
- Defines what happens when we scrol down
+ Defines what happens when we scroll up
+ """
+ pass
+
+ def on_line_up(self):
+ """
+ Defines what happens when we scroll one line up
+ """
+ pass
+
+ def on_line_down(self):
+ """
+ Defines what happens when we scroll one line up
"""
pass
@@ -505,6 +517,18 @@ class ChatTab(Tab):
def command_say(self, line):
raise NotImplementedError
+ def on_line_up(self):
+ self.text_win.scroll_up(1)
+
+ def on_line_down(self):
+ self.text_win.scroll_down(1)
+
+ def on_scroll_up(self):
+ self.text_win.scroll_up(self.text_win.height-1)
+
+ def on_scroll_down(self):
+ self.text_win.scroll_down(self.text_win.height-1)
+
class MucTab(ChatTab):
"""
@@ -1055,12 +1079,6 @@ class MucTab(ChatTab):
if self.joined and config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) == 'true' and not self.input.get_text():
self.send_chat_state('active')
- def on_scroll_up(self):
- self.text_win.scroll_up(self.text_win.height-1)
-
- def on_scroll_down(self):
- self.text_win.scroll_down(self.text_win.height-1)
-
def on_info_win_size_changed(self):
if self.core.information_win_size >= self.height-3:
return
@@ -1555,12 +1573,6 @@ class PrivateTab(ChatTab):
if tab and tab.joined and config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) == 'true' and not self.input.get_text():
self.send_chat_state('active')
- def on_scroll_up(self):
- self.text_win.scroll_up(self.text_win.height-1)
-
- def on_scroll_down(self):
- self.text_win.scroll_down(self.text_win.height-1)
-
def on_info_win_size_changed(self):
if self.core.information_win_size >= self.height-3:
return
@@ -2340,12 +2352,6 @@ class ConversationTab(ChatTab):
if resource:
self.send_chat_state('active')
- def on_scroll_up(self):
- self.text_win.scroll_up(self.text_win.height-1)
-
- def on_scroll_down(self):
- self.text_win.scroll_down(self.text_win.height-1)
-
def on_info_win_size_changed(self):
if self.core.information_win_size >= self.height-3:
return