From 77ce5c68b01039a329a109dbd2317c645a87b26d Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Mon, 10 May 2021 18:06:06 +1000 Subject: [PATCH] Make the summary pane narrower and listing pane wider. - In portrait mode. - In the average project there was a bit of wasted space. Python files (with lots of statuses) in a subdirectory had space left over. They can still be seen with the summary pane narrowed. - Puts emphasis on viewing the listing over the summary pane. - Contents were often a little too wide for the listing pane and now fit. --- eris/__main__.py | 8 ++- tests/golden-files/initial | 118 ++++++++++++++++++------------------- 2 files changed, 65 insertions(+), 61 deletions(-) diff --git a/eris/__main__.py b/eris/__main__.py index f3dfb59..7922cab 100755 --- a/eris/__main__.py +++ b/eris/__main__.py @@ -728,6 +728,10 @@ class Screen: smaller_height = max(height // 4, 10) return [smaller_height, height - smaller_height] + def _partition_3(self, widgets, width): + smaller_width = max(int(width // 2.5), 10) + return [smaller_width, width - smaller_width] + def _make_widgets(self): self._help_widget = Help(self._summary, self) root_path = os.path.basename(self._summary._root_path) @@ -743,10 +747,10 @@ class Screen: log = fill3.Border(self._log, title="Log", characters=Screen._DIMMED_BORDER) port_log = fill3.Row([fill3.Column([summary, log], self._partition), - self._listing]) + self._listing], self._partition_3) land_log = fill3.Column([fill3.Row([summary, log]), self._listing], self._partition_2) - port_no_log = fill3.Row([summary, self._listing]) + port_no_log = fill3.Row([summary, self._listing], self._partition_3) land_no_log = fill3.Column([summary, self._listing], self._partition_2) self._layouts = [[land_no_log, port_no_log], [land_log, port_log]] self._set_focus() diff --git a/tests/golden-files/initial b/tests/golden-files/initial index 25d13b2..ede14d5 100644 --- a/tests/golden-files/initial +++ b/tests/golden-files/initial @@ -1,60 +1,60 @@ -┏━━━━━━━━━━━━━━ Summary of project ━━━━━━━━━━━━━━┓┌────────────────────────────────────────────────┐ -┃ ┃│Nothing selected │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┃ ┃│ │ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛│ │ -┌───────────────────── Log ──────────────────────┐│ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -│ ││ │ -└────────────────────────────────────────────────┘└────────────────────────────────────────────────┘ +┏━━━━━━━━ Summary of project ━━━━━━━━┓┌────────────────────────────────────────────────────────────┐ +┃ ┃│Nothing selected │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┃ ┃│ │ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛│ │ +┌─────────────── Log ────────────────┐│ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +│ ││ │ +└────────────────────────────────────┘└────────────────────────────────────────────────────────────┘  help quit tab:focus orient log edit next sort refresh fullscreen xdg-open  \ No newline at end of file