Skip to content

Commit af76a06

Browse files
committed
ui: Improve Column spacing w.r.t. width.
1 parent e9edefa commit af76a06

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

zulipterminal/ui.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ def main_window(self) -> Any:
133133
self.right_panel = self.right_column_view()
134134
if self.controller.autohide:
135135
body = [
136-
(View.LEFT_WIDTH, self.left_panel),
137-
("weight", 10, self.center_panel),
136+
("weight", 20, self.left_panel),
137+
("weight", 80, self.center_panel),
138138
(0, self.right_panel),
139139
]
140140
else:
141141
body = [
142-
(View.LEFT_WIDTH, self.left_panel),
143-
("weight", 10, self.center_panel),
144-
(View.RIGHT_WIDTH, self.right_panel),
142+
("weight", 20, self.left_panel),
143+
("weight", 65, self.center_panel),
144+
("weight", 15, self.right_panel),
145145
]
146146
self.body = urwid.Columns(body, focus_column=0)
147147

@@ -176,22 +176,16 @@ def main_window(self) -> Any:
176176
def show_left_panel(self, *, visible: bool) -> None:
177177
if not self.controller.autohide:
178178
return
179-
width = View.LEFT_WIDTH if visible else 0
180-
self.body.contents[0] = (
181-
self.left_panel,
182-
self.body.options(width_type="given", width_amount=width),
183-
)
179+
option = ("weight", 20) if visible else ("given", 0)
180+
self.body.contents[0] = (self.left_panel, self.body.options(*option))
184181
if visible:
185182
self.body.focus_position = 0
186183

187184
def show_right_panel(self, *, visible: bool) -> None:
188185
if not self.controller.autohide:
189186
return
190-
width = View.RIGHT_WIDTH if visible else 0
191-
self.body.contents[2] = (
192-
self.right_panel,
193-
self.body.options(width_type="given", width_amount=width),
194-
)
187+
option = ("weight", 15) if visible else ("given", 0)
188+
self.body.contents[2] = (self.right_panel, self.body.options(*option))
195189
if visible:
196190
self.body.focus_position = 2
197191

0 commit comments

Comments
 (0)