[tor-commits] [nyx/master] Allow boxes to expand past screen bounds

atagar at torproject.org atagar at torproject.org
Tue Aug 15 17:44:17 UTC 2017


commit 19abc43cf3b5067f2de045c79e79452e7e2f2ab6
Author: Damian Johnson <atagar at torproject.org>
Date:   Tue Aug 15 10:28:37 2017 -0700

    Allow boxes to expand past screen bounds
    
    Any time we drew a box the maximum bounds only went up to the screen edge. This
    caused the bounding box for dates to always show a bottom border, even if there
    were more lines.
---
 nyx/curses.py    | 8 ++++----
 nyx/panel/log.py | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/nyx/curses.py b/nyx/curses.py
index 3670629..cb47bb6 100644
--- a/nyx/curses.py
+++ b/nyx/curses.py
@@ -819,11 +819,11 @@ class _Subwindow(object):
     :param list attr: text attributes to apply
     """
 
-    max_width = self.width - left
-    max_height = self.height - top
+    if width is None:
+      width = self.width - left
 
-    width = max_width if width is None else min(width, max_width)
-    height = max_height if height is None else min(height, max_height)
+    if height is None:
+      height = self.height - top
 
     self.hline(left + 1, top, width - 2, *attr)  # top
     self.hline(left + 1, top + height - 1, width - 2, *attr)  # bottom
diff --git a/nyx/panel/log.py b/nyx/panel/log.py
index be3b8c0..d364470 100644
--- a/nyx/panel/log.py
+++ b/nyx/panel/log.py
@@ -385,7 +385,7 @@ def _draw_entries(subwindow, x, y, event_log, show_duplicates):
       for entry in day_to_entries[day]:
         y = _draw_entry(subwindow, x + 1, y, subwindow.width - 1, entry, show_duplicates)
 
-      subwindow.box(x, original_y, subwindow.width - x + 2, y - original_y + 1, YELLOW, BOLD)
+      subwindow.box(x, original_y, subwindow.width - x, y - original_y + 1, YELLOW, BOLD)
       time_label = time.strftime(' %B %d, %Y ', time.localtime(day_to_entries[day][0].timestamp))
       subwindow.addstr(x + 2, original_y, time_label, YELLOW, BOLD)
 



More information about the tor-commits mailing list