269
269
(self.top + self.highlight + 1) != visible_length and
270
270
(self.highlight + 1) != (self.image.size.height - 4)):
271
271
self.highlight += 1
274
class ShowRerun(ScrollableTreeNode):
275
""" Display the re-run screen."""
276
def __init__(self, tree, title):
277
super().__init__(tree, title)
279
def consume_event(self, event: Event):
280
if event.kind == EVENT_RESIZE:
281
self.image = TextImage(event.data) # data is the new size
282
elif event.kind == EVENT_KEYBOARD:
283
self.image = TextImage(self.image.size)
284
if event.data.key == "up":
286
elif event.data.key == "down":
288
elif event.data.key == "space":
290
elif event.data.key == "enter":
292
elif event.data.key in 'sS':
293
self.tree.set_descendants_state(True)
294
elif event.data.key in 'dD':
295
self.tree.set_descendants_state(False)
296
elif event.data.key in 'fF':
297
self.tree.set_descendants_state(False)
299
elif event.data.key in 'rR':
304
def repaint(self, event: Event):
305
ctx = DrawingContext(self.image)
306
ctx.border(tm=1, bm=1)
307
cols = self.image.size.width
310
extra_cols = cols - 80
311
ctx.attributes.style = REVERSE
312
ctx.print(' ' * cols)
314
bottom = self.top + self.image.size.height - 4
315
ctx.print(self.title)
316
ctx.move_to(1, self.image.size.height - 1)
317
ctx.attributes.style = REVERSE
318
ctx.print(_("Enter"))
319
ctx.move_to(6, self.image.size.height - 1)
320
ctx.attributes.style = NORMAL
321
ctx.print(_(": Expand/Collapse"))
322
ctx.move_to(27, self.image.size.height - 1)
323
ctx.attributes.style = REVERSE
324
# FIXME: i18n problem
326
ctx.move_to(28, self.image.size.height - 1)
327
ctx.attributes.style = NORMAL
328
ctx.print("elect All")
329
ctx.move_to(41, self.image.size.height - 1)
330
ctx.attributes.style = REVERSE
331
# FIXME: i18n problem
333
ctx.move_to(42, self.image.size.height - 1)
334
ctx.attributes.style = NORMAL
335
ctx.print("eselect All")
336
ctx.move_to(63 + extra_cols, self.image.size.height - 1)
337
ctx.attributes.style = REVERSE
338
# FIXME: i18n problem
340
ctx.move_to(64 + extra_cols, self.image.size.height - 1)
341
ctx.attributes.style = NORMAL
342
ctx.print(_("inish"))
343
ctx.move_to(73 + extra_cols, self.image.size.height - 1)
344
ctx.attributes.style = REVERSE
345
# FIXME: i18n problem
347
ctx.move_to(74 + extra_cols, self.image.size.height - 1)
348
ctx.attributes.style = NORMAL
350
for i, line in enumerate(self.tree.render(cols - 3)[self.top:bottom]):
351
ctx.move_to(2, i + 2)
352
if i != self.highlight:
353
ctx.attributes.style = NORMAL
354
else: # highlight the current line
355
ctx.attributes.style = REVERSE