MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _draw_screen_header

Method _draw_screen_header

pager/pager_display.py:455–480  ·  view source on GitHub ↗

Draw the top header bar with title, screen dots, and nav hint.

(self, title)

Source from the content-addressed store, hash-verified

453 return False
454
455 def _draw_screen_header(self, title):
456 """Draw the top header bar with title, screen dots, and nav hint."""
457 h = 24
458 self.pager.fill_rect(0, 0, self.width, h, self.HEADER_BG)
459 self.pager.draw_ttf(8, 2, title, self.WHITE, self.font_viking, 18)
460
461 # Compact screen indicator dots (6px spacing, fits 8 screens in 56px)
462 DOT_SIZE = 4
463 DOT_SPACING = 6
464 total_dots_w = SCREEN_COUNT * DOT_SPACING
465 dot_x_start = self.width - total_dots_w - 8
466 dot_y = 10
467 for i in range(SCREEN_COUNT):
468 dx = dot_x_start + i * DOT_SPACING
469 # Settings screens get a distinct color (purple) when inactive
470 if i in SETTINGS_SCREENS:
471 color = self.CYAN if i == self.current_screen else self.PURPLE
472 else:
473 color = self.CYAN if i == self.current_screen else self.DARK_GRAY
474 self.pager.fill_rect(dx, dot_y, DOT_SIZE, DOT_SIZE, color)
475
476 # Nav hint: show adjacent screen names compactly
477 left_name = SCREEN_NAMES[(self.current_screen - 1) % SCREEN_COUNT]
478 right_name = SCREEN_NAMES[(self.current_screen + 1) % SCREEN_COUNT]
479 hint = f"<{left_name} {right_name}>"
480 self.pager.draw_ttf(dot_x_start - 120, 4, hint, self.DARK_GRAY, self.font_arial, 10)
481
482 def _draw_stat_card(self, x, y, w, h, value, label, color):
483 """Draw a single stat card with big number and label."""

Callers 5

draw_dashboardMethod · 0.95
draw_hostsMethod · 0.95
draw_credentialsMethod · 0.95
draw_vulnerabilitiesMethod · 0.95
_draw_settings_screenMethod · 0.95

Calls 3

rangeFunction · 0.85
fill_rectMethod · 0.45
draw_ttfMethod · 0.45

Tested by

no test coverage detected