Browse Source

feat: always display an arrow next to unfoldable

nottui-full-sensor
Simon Cruanes 1 year ago
committed by Frédéric Bour
parent
commit
729ee623cf
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/nottui-widgets/nottui_widgets.ml

+ 2
- 2
lib/nottui-widgets/nottui_widgets.ml View File

@ -420,8 +420,8 @@ let unfoldable ?(folded_by_default=true) summary (f: unit -> Ui.t Lwd.t) : Ui.t
(* pad summary with a "> " when it's opened *)
let summary =
Lwd.get opened >>= function
| true -> Lwd.map (Ui.join_x (string ~attr:A.(bg blue) "> ")) summary
| false -> summary
| true -> Lwd.map (Ui.join_x (string "🔽")) summary
| false -> Lwd.map (Ui.join_x (string "▶️ ")) summary
in
let cursor ~x:_ ~y:_ = function
| `Left when Lwd.peek opened -> Lwd.set opened false; `Handled


Loading…
Cancel
Save