@@ -107,8 +107,8 @@ def set_footer_text(
107
107
text = self .get_random_help ()
108
108
else :
109
109
text = text_list
110
- self ._w .footer .set_text (text )
111
- self ._w .footer .set_attr_map ({None : style })
110
+ self .frame .footer .set_text (text )
111
+ self .frame .footer .set_attr_map ({None : style })
112
112
self .controller .update_screen ()
113
113
if duration is not None :
114
114
assert duration > 0
@@ -142,17 +142,19 @@ def main_window(self) -> Any:
142
142
self .right_panel , self .right_tab = self .right_column_view ()
143
143
if self .controller .autohide :
144
144
body = [
145
- (LEFT_WIDTH , self .left_panel ),
145
+ (TAB_WIDTH , self .left_tab ),
146
146
("weight" , 10 , self .center_panel ),
147
147
(TAB_WIDTH , self .right_tab ),
148
148
]
149
+ focus_column = 1
149
150
else :
150
151
body = [
151
152
(LEFT_WIDTH , self .left_panel ),
152
153
("weight" , 10 , self .center_panel ),
153
154
(RIGHT_WIDTH , self .right_panel ),
154
155
]
155
- self .body = urwid .Columns (body , focus_column = 0 )
156
+ focus_column = 0
157
+ self .body = urwid .Columns (body , focus_column = focus_column )
156
158
157
159
# NOTE: message_view is None, but middle_column_view is called above
158
160
# and sets it.
@@ -177,24 +179,46 @@ def main_window(self) -> Any:
177
179
]
178
180
)
179
181
180
- w = urwid .Frame (
182
+ self . frame = urwid .Frame (
181
183
self .body , title_bar , focus_part = "body" , footer = self .footer_view ()
182
184
)
183
- return w
185
+
186
+ # Show overlayed left panel on startup in autohide mode
187
+ self .show_left_panel (visible = True )
188
+
189
+ return self .frame
184
190
185
191
def show_left_panel (self , * , visible : bool ) -> None :
186
192
if not self .controller .autohide :
187
193
return
188
- option = ("given" , LEFT_WIDTH ) if visible else ("given" , TAB_WIDTH )
189
- widget = self .left_panel if visible else self .left_tab
190
- self .body .contents [0 ] = (widget , self .body .options (* option ))
194
+
195
+ if visible :
196
+ self .frame .body = urwid .Overlay (
197
+ urwid .Columns ([self .left_panel , (1 , urwid .SolidFill ("▏" ))]),
198
+ self .body ,
199
+ align = "left" ,
200
+ width = LEFT_WIDTH ,
201
+ valign = "top" ,
202
+ height = ("relative" , 100 ),
203
+ )
204
+ else :
205
+ self .frame .body = self .body
191
206
192
207
def show_right_panel (self , * , visible : bool ) -> None :
193
208
if not self .controller .autohide :
194
209
return
195
- option = ("given" , RIGHT_WIDTH ) if visible else ("given" , TAB_WIDTH )
196
- widget = self .right_panel if visible else self .right_tab
197
- self .body .contents [2 ] = (widget , self .body .options (* option ))
210
+
211
+ if visible :
212
+ self .frame .body = urwid .Overlay (
213
+ urwid .Columns ([(1 , urwid .SolidFill ("▕" )), self .right_panel ]),
214
+ self .body ,
215
+ align = "right" ,
216
+ width = LEFT_WIDTH ,
217
+ valign = "top" ,
218
+ height = ("relative" , 100 ),
219
+ )
220
+ else :
221
+ self .frame .body = self .body
198
222
199
223
def keypress (self , size : urwid_Box , key : str ) -> Optional [str ]:
200
224
self .model .new_user_input = True
0 commit comments