parent
66895d1aeb
commit
b4c68e3ada
|
@ -45,7 +45,7 @@ class Application:
|
||||||
self.y, self.x = self.stdscr.getmaxyx()
|
self.y, self.x = self.stdscr.getmaxyx()
|
||||||
|
|
||||||
# initialize some basic stuff
|
# initialize some basic stuff
|
||||||
self.margins_visible = False
|
self.margins_visible = True
|
||||||
#self.margins = [(80, 'blue'), (90, 'red')]
|
#self.margins = [(80, 'blue'), (90, 'red')]
|
||||||
self.margins = [(80, 'blue'), ]
|
self.margins = [(80, 'blue'), ]
|
||||||
# each highlighted_range contains three things: [window, start_p, end_p]
|
# each highlighted_range contains three things: [window, start_p, end_p]
|
||||||
|
@ -483,12 +483,13 @@ class Application:
|
||||||
self.draw_status_bar(i)
|
self.draw_status_bar(i)
|
||||||
|
|
||||||
def draw_slot(self, i):
|
def draw_slot(self, i):
|
||||||
#return
|
|
||||||
slot = self.bufferlist.slots[i]
|
slot = self.bufferlist.slots[i]
|
||||||
if slot.window is None:
|
if slot.window is None:
|
||||||
return
|
return
|
||||||
w = slot.window
|
w = slot.window
|
||||||
|
|
||||||
|
redattr = color.build_attr(color.pairs('red', 'default'))
|
||||||
|
|
||||||
lines = w.buffer.lines
|
lines = w.buffer.lines
|
||||||
count = 0
|
count = 0
|
||||||
(x, y) = w.first.xy()
|
(x, y) = w.first.xy()
|
||||||
|
@ -497,7 +498,7 @@ class Application:
|
||||||
(px, py) = (None, None)
|
(px, py) = (None, None)
|
||||||
while count < slot.height:
|
while count < slot.height:
|
||||||
if y >= len(lines):
|
if y >= len(lines):
|
||||||
self.win.addstr(count, 0, '~' + ' ' * (slot.width - 1))
|
self.win.addstr(count, 0, '~' + ' ' * (slot.width - 1), redattr)
|
||||||
else:
|
else:
|
||||||
if cy == y and cx >= x and cx < x + slot.width:
|
if cy == y and cx >= x and cx < x + slot.width:
|
||||||
px = cx - x
|
px = cx - x
|
||||||
|
@ -518,13 +519,13 @@ class Application:
|
||||||
if self.margins_visible:
|
if self.margins_visible:
|
||||||
for (limit, shade) in self.margins:
|
for (limit, shade) in self.margins:
|
||||||
if self.x > limit:
|
if self.x > limit:
|
||||||
for i in range(0, y):
|
for j in range(0, slot.height):
|
||||||
# the actual character is the lower 8 bits, and the
|
# the actual character is the lower 8 bits, and the
|
||||||
# attribute is the upper 8 bits; we will ignore the
|
# attribute is the upper 8 bits; we will ignore the
|
||||||
# attribute and just get the character
|
# attribute and just get the character
|
||||||
char = self.win.inch(i + slot.offset, limit) & 255
|
char = self.win.inch(j + slot.offset, limit) & 255
|
||||||
attr = color.build('default', shade, 'bold')
|
attr = color.build('default', shade, 'bold')
|
||||||
self.win.addch(i + slot.offset, limit, char, attr)
|
self.win.addch(j + slot.offset, limit, char, attr)
|
||||||
|
|
||||||
if self.mini_active is False and self.active_slot == i:
|
if self.mini_active is False and self.active_slot == i:
|
||||||
if False and w.active_point is not None and w.point_is_visible(w.active_point):
|
if False and w.active_point is not None and w.point_is_visible(w.active_point):
|
||||||
|
@ -587,10 +588,10 @@ class Application:
|
||||||
|
|
||||||
# XYZ: we should actually use more of the 'state' variables
|
# XYZ: we should actually use more of the 'state' variables
|
||||||
|
|
||||||
#format = "----:%s-Fl %-18s (%s)--L%d--C%d--%s"
|
format = "----:%s-Fl %-18s (%s)--L%d--C%d--%s"
|
||||||
#status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, perc)
|
status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, perc)
|
||||||
format = "----:%s-Fl %-18s (%s)--L%d--C%d--%s--%s--%s"
|
#format = "----:%s-Fl %-18s (%s)--L%d--C%d--%s--%s--%s"
|
||||||
status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, w.first, w.last, perc)
|
#status = format % (modflag, name, w.mode.name(), cursor.y+1, cursor.x+1, w.first, w.last, perc)
|
||||||
status = status[:slot.width + 1]
|
status = status[:slot.width + 1]
|
||||||
status += "-" * (slot.width - len(status) + 1)
|
status += "-" * (slot.width - len(status) + 1)
|
||||||
self.win.addnstr(slot.height + slot.offset, 0, status, slot.width + 1,
|
self.win.addnstr(slot.height + slot.offset, 0, status, slot.width + 1,
|
||||||
|
|
Loading…
Reference in New Issue