more debug

This commit is contained in:
cqc
2023-02-13 09:29:47 -06:00
parent 5c11183217
commit 53982ab0c6

View File

@ -573,7 +573,8 @@ module NVG = struct
include Graphv_webgl.Color
let none = Color.transparent
let transparent = rgbaf ~r:0. ~g:0. ~b:0. ~a:0.000001
(* let transparent = rgbaf ~r:0. ~g:0. ~b:0. ~a:0.000001 *)
let gray a = rgbf ~r:a ~g:a ~b:a
let light = gray 0.8
let dark = gray 0.2
@ -1260,7 +1261,7 @@ module Nottui = struct
let request_var (v : var) =
incr clock;
Log.debug (fun m ->
m "Focus.request_var v=%d clock=%d" (Lwd.peek v) !clock);
m "Focus.request_var v=%d->%d" (Lwd.peek v) !clock);
Lwd.set v !clock
let request ((v, _) : handle) = request_var v
@ -1621,10 +1622,9 @@ module Nottui = struct
let has_focus t = Focus.has_focus t.focus
let rec pp ppf t =
if has_focus t then
F.pf ppf "@[<hov>%a %a@]" Focus.pp_status t.focus pp_desc
t.desc
else F.pf ppf "@[<hov> %a@]" pp_desc t.desc
(* if has_focus t then*)
F.pf ppf "@[<hov>%a %a@]" Focus.pp_status t.focus pp_desc t.desc
(* else F.pf ppf "@[<hov> %a@]" pp_desc t.desc *)
and pp_desc ppf = function
| Atom a ->
@ -1814,7 +1814,10 @@ module Nottui = struct
let update_focus ui =
match ui.focus with
| Focus.Empty | Focus.Handle _ -> ()
| Focus.Conflict i -> solve_focus ui i
| Focus.Conflict i ->
Log.debug (fun m ->
m "update_focus Conflict %d -> solve_focus ()" i);
solve_focus ui i
let rec t_size_desc_of_t vg (size : box2) (ui : Ui.t desc) =
match ui with
@ -3201,7 +3204,11 @@ module Widgets = struct
Lwd.peek cursor
|> Option.iter (fun cursor ->
Lwd_table.get cursor
|> Option.iter (fun (f, _) -> Focus.request f));
|> Option.iter (fun (f, _) ->
Log.debug (fun m ->
m "tree_nav has_focus request %a"
Focus.pp_status focus');
Focus.request f));
Ui.keyboard_area ~focus:focus' (fun k ->
Log.debug (fun m ->
m "keyboard_area: tree_nav %a" Ui.pp_keys k);