···114114 (** Makes a UI element responsive to terminal width and focus state
115115 - When focused: shows at full width if terminal is wide enough, or fills terminal if narrow
116116 - When unfocused: shows at normal width if terminal is wide enough, or collapses if narrow *)
117117- let responsive_view ?(shrunk_width=0) ?(shrink_on= `Focus) ui =
117117+ let responsive_view ?(shrunk_width=0) ?(shrink_on= `Focus) ~focus ui =
118118 let$* w, h = Lwd.get Vars.term_width_height in
119119- let$ ui = ui in
119119+ let$ ui = ui
120120+and$ focus = focus|>Focus.status in
120121121122 let should_shrink = match shrink_on with
122122- | `Focus -> Ui.has_focus ui
123123- | `Unfocus -> not (Ui.has_focus ui)
123123+ | `Focus -> focus|>Focus.has_focus
124124+ | `Unfocus -> not (focus|>Focus.has_focus)
125125+124126 in
125127 let threhold=(Lwd.peek Vars.config).single_pane_width_threshold in
126128 if should_shrink
···174176 ~mw:1000)
175177 |> W.Box.focusable ~focus:branch_focus ~pad_h:0 ~pad_w:1
176178 ]
177177- |> responsive_view ~shrunk_width:0
179179+ |> responsive_view ~focus:summary_focus ~shrink_on:`Unfocus ~shrunk_width:0
178180 ; (*Right side summary/status/fileinfo view*)
179181 (let ui =
180182 Show_view.render summary_focus
···184186 |> W.on_focus ~focus:summary_focus (Ui.resize ~sw:3 ~mw:1000)
185187 |> W.Box.focusable ~focus:summary_focus ~pad_h:0 ~pad_w:1
186188 in
187187- responsive_view ~shrunk_width:0 ui)
189189+ responsive_view ~focus:summary_focus ~shrunk_width:0 ui)
188190 ]
189191 (*These outer prompts can popup and show them selves over the main view*)
190192 |> W.Overlay.text_prompt ~char_count:true ~show_prompt_var:ui_state.show_prompt