terminal user interface to jujutsu. Focused on speed and clarity
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

give text input configurable focused style

Eli Dowling 46dda730 ab6ccea4

+4 -2
+3 -2
forks/nottui/lib/nottui/widgets/nottui_widgets.ml
··· 101 101 102 102 let sub' str p l = if p = 0 && l = String.length str then str else String.sub str p l 103 103 104 - let edit_field ?(focus = Focus.make ()) state ~on_change ~on_submit = 104 + let edit_field ?(focus = Focus.make ()) ?(attr_focused = A.(empty)) state ~on_change ~on_submit = 105 105 let update focus_h focus (text, pos) = 106 106 let pos = clampi pos ~min:0 ~max:(String.length text) in 107 107 let content = ··· 110 110 @@ 111 111 if Focus.has_focus focus 112 112 then ( 113 - let attr = A.(st italic) in 113 + (* sets the styling when focused *) 114 + let attr = A.(attr_focused ++ st underline) in 114 115 let len = String.length text in 115 116 (if pos >= len 116 117 then [ I.string attr text ]
+1
forks/nottui/lib/nottui/widgets/nottui_widgets.mli
··· 14 14 Supports navigating with arrow keys *) 15 15 val edit_field 16 16 : ?focus:Focus.handle 17 + -> ?attr_focused:attr 17 18 -> (string * int) Lwd.t 18 19 -> on_change:(string * int -> unit) 19 20 -> on_submit:(string * int -> unit)