···8181 }
82828383let text_prompt
8484- ?pad_h
8585- ?pad_w
8686- ?(modify_body = fun x -> x)
8787- ?(focus = Focus.make ())
8888- ?(char_count = false)
8989- ~(show_prompt_var : text_prompt_data Option.t Lwd.var)
9090- ui
8484+ ?pad_h
8585+ ?pad_w
8686+ ?(modify_body = fun x -> x)
8787+ ?(focus = Focus.make ())
8888+ ?(char_count = false)
8989+ ~(show_prompt_var : text_prompt_data Option.t Lwd.var)
9090+ ui
9191 =
9292 let prompt_input = Lwd.var ("", 0) in
9393 let prompt_val = Lwd.get prompt_input in
···135135(* TODO: Write a ui resize function that takes an optional version of the layout spec where eveyr field is optional too, then we can use that when we want to make a widget with a custom internal state, or i can just use w mw h mw etc *)
136136137137let selection_list_prompt
138138- ?pad_w
139139- ?pad_h
140140- ?(modify_body = fun x -> x)
141141- ?(focus = Focus.make ())
142142- ~show_prompt_var
143143- ui
138138+ ?pad_w
139139+ ?pad_h
140140+ ?(modify_body = fun x -> x)
141141+ ?(focus = Focus.make ())
142142+ ~show_prompt_var
143143+ ui
144144 =
145145 (*Build the ui so that it is either the prompt or nothing depending on whether show prompt is enabled*)
146146 let prompt_args =
···183183 }
184184185185let selection_list_prompt_filterable
186186- ?pad_w
187187- ?pad_h
188188- ?(modify_body = fun x -> x)
189189- ?(focus = Focus.make ())
190190- ~show_prompt_var
191191- ui
186186+ ?pad_w
187187+ ?pad_h
188188+ ?(modify_body = fun x -> x)
189189+ ?(focus = Focus.make ())
190190+ ~show_prompt_var
191191+ ui
192192 =
193193 (*Build the ui so that it is either the prompt or nothing depending on whether show prompt is enabled*)
194194 let prompt_args =
···229229 Focus.request_reversable focus;
230230 prompt_field |> Ui.resize ~w:5 ~sw:1
231231 in
232232- ui |> BB.focusable ~focus ~label_top:label ?on_key |> clear_bg
232232+ ui
233233+ |> BB.focusable ~focus ~label_top:label ?on_key
234234+ |> clear_bg
235235+ (*This is a little confusing, but by wrapping the content in 2 nested keyboard areas we make it the user cannot escape the popup.
236236+ becasue focus moves between keyboard areas within a current keyboard area by adding 2 we make escape impossible *)
237237+ |> Lwd.map ~f:(fun ui ->
238238+ ui |> Ui.keyboard_area (fun x -> `Unhandled))
233239 | None ->
234240 Focus.release_reversable focus;
235241 Ui.empty |> Lwd.pure