diff options
-rw-r--r-- | ranger/ext/img_display.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index 699f04d9..a9d85282 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -76,9 +76,13 @@ class W3MImageDisplayer(ImageDisplayer): cmd = "6;{x};{y};{w};{h}\n4;\n3;\n".format( x = int((start_x - 0.2) * fontw), - y = int((start_y + 0.6) * fonth), + # (for tmux top status line) + # y = int((start_y + 0.6) * fonth), + y = int((start_y - 0.4) * fonth), w = int((width + 0.4) * fontw), - h = int((height - 0.6) * fonth)) + # (for tmux top status line) + # h = int((height - 0.2) * fonth) + 1) + h = int((height + 0.6) * fonth) + 1) self.process.stdin.write(cmd) self.process.stdin.flush() @@ -95,7 +99,9 @@ class W3MImageDisplayer(ImageDisplayer): raise ImgDisplayUnsupportedException() max_width_pixels = max_width * fontw - max_height_pixels = (max_height - 1) * fonth + # (for tmux top status line) + # max_height_pixels = int((max_height - 0.5) * fonth + 1) + max_height_pixels = int((max_height + 0.5) * fonth) + 1 # get image size cmd = "5;{}\n".format(path) @@ -120,7 +126,9 @@ class W3MImageDisplayer(ImageDisplayer): return "0;1;{x};{y};{w};{h};;;;;{filename}\n4;\n3;\n".format( x = int((start_x - 0.2) * fontw), - y = int((start_y + 0.6) * fonth), + # (for tmux top status line) + # y = int((start_y + 0.6) * fonth), + y = int((start_y - 0.4) * fonth), w = width, h = height, filename = path) |