indicates the number of available lines to be scrolled down fixed #1674
This commit is contained in:
parent
d364c1f4f3
commit
567491ba43
2 changed files with 12 additions and 4 deletions
|
@ -198,6 +198,8 @@ class Gui(object):
|
||||||
curses.COLOR_YELLOW)
|
curses.COLOR_YELLOW)
|
||||||
curses.init_pair(15, curses.COLOR_WHITE, # new message in private room
|
curses.init_pair(15, curses.COLOR_WHITE, # new message in private room
|
||||||
curses.COLOR_GREEN)
|
curses.COLOR_GREEN)
|
||||||
|
curses.init_pair(16, curses.COLOR_YELLOW,
|
||||||
|
curses.COLOR_BLUE)
|
||||||
|
|
||||||
def reset_curses(self):
|
def reset_curses(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -150,6 +150,15 @@ class RoomInfo(Win):
|
||||||
def resize(self, height, width, y, x, stdscr, visible):
|
def resize(self, height, width, y, x, stdscr, visible):
|
||||||
self._resize(height, width, y, x, stdscr)
|
self._resize(height, width, y, x, stdscr)
|
||||||
|
|
||||||
|
def print_scroll_position(self, current_room):
|
||||||
|
"""
|
||||||
|
Print, link in Weechat, a -PLUS(n)- where n
|
||||||
|
is the number of available lines to scroll
|
||||||
|
down
|
||||||
|
"""
|
||||||
|
if current_room.pos > 0:
|
||||||
|
self.win.addstr(' -PLUS(%s)-' % current_room.pos, curses.color_pair(16) | curses.A_BOLD)
|
||||||
|
|
||||||
def refresh(self, rooms, current):
|
def refresh(self, rooms, current):
|
||||||
if not self.visible:
|
if not self.visible:
|
||||||
return
|
return
|
||||||
|
@ -175,6 +184,7 @@ class RoomInfo(Win):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
|
self.print_scroll_position(current)
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
self.win.addstr(' ', curses.color_pair(1))
|
self.win.addstr(' ', curses.color_pair(1))
|
||||||
|
@ -259,10 +269,6 @@ class TextWin(Win):
|
||||||
if not self.visible:
|
if not self.visible:
|
||||||
return
|
return
|
||||||
self.win.erase()
|
self.win.erase()
|
||||||
# if room.pos != 0:
|
|
||||||
# messages = room.messages[-self.height - room.pos : -room.pos]
|
|
||||||
# else:
|
|
||||||
# messages = room.messages[-self.height:]
|
|
||||||
lines = self.build_lines_from_messages(room.messages)
|
lines = self.build_lines_from_messages(room.messages)
|
||||||
if room.pos + self.height > len(lines):
|
if room.pos + self.height > len(lines):
|
||||||
room.pos = len(lines) - self.height
|
room.pos = len(lines) - self.height
|
||||||
|
|
Loading…
Reference in a new issue