aports/testing/ocaml-lwd/notty-latest-git.patch
2022-05-16 15:34:54 +00:00

67 lines
2.6 KiB
Diff

--- a/lib/nottui/nottui.ml
+++ b/lib/nottui/nottui.ml
@@ -655,7 +655,7 @@
let image = resize_canvas2 dx dy sw sh c.image in
let image =
if bg != A.empty then
- I.(image </> char bg ' ' sw sh)
+ I.(image </> char ~attr:bg ' ' sw sh)
else
image
in
--- a/lib/nottui/nottui_widgets.ml
+++ b/lib/nottui/nottui_widgets.ml
@@ -18,10 +18,10 @@
let rec split str i =
match control_character_index str i with
| j ->
- let img = I.string attr (String.sub str i (j - i)) in
+ let img = I.string ~attr (String.sub str i (j - i)) in
img :: split str (j + 1)
| exception Not_found ->
- [I.string attr
+ [I.string ~attr
(if i = 0 then str
else String.sub str i (String.length str - i))]
in
@@ -371,15 +371,15 @@
let attr = attr_clickable in
let len = String.length text in
(if pos >= len
- then [I.string attr text]
- else [I.string attr (sub' text 0 pos)])
+ then [I.string ~attr text]
+ else [I.string ~attr (sub' text 0 pos)])
@
(if pos < String.length text then
- [I.string A.(bg lightred) (sub' text pos 1);
- I.string attr (sub' text (pos + 1) (len - pos - 1))]
- else [I.string A.(bg lightred) " "]);
+ [I.string ~attr:A.(bg lightred) (sub' text pos 1);
+ I.string ~attr (sub' text (pos + 1) (len - pos - 1))]
+ else [I.string ~attr:A.(bg lightred) " "]);
) else
- [I.string A.(st underline) (if text = "" then " " else text)]
+ [I.string ~attr:A.(st underline) (if text = "" then " " else text)]
in
let handler = function
| `ASCII 'U', [`Ctrl] -> on_change ("", 0); `Handled (* clear *)
@@ -720,7 +720,7 @@
let prefix = offset * visible / total in
let suffix = (total - offset - visible) * visible / total in
let handle = visible - prefix - suffix in
- let render size color = Ui.atom Notty.(I.char (A.bg color) ' ' size 1) in
+ let render size color = Ui.atom Notty.(I.char ~attr:(A.bg color) ' ' size 1) in
let mouse_handler ~x ~y:_ = function
| `Left ->
if x < prefix then
@@ -748,7 +748,7 @@
let prefix = offset * visible / total in
let suffix = (total - offset - visible) * visible / total in
let handle = visible - prefix - suffix in
- let render size color = Ui.atom Notty.(I.char (A.bg color) ' ' 1 size) in
+ let render size color = Ui.atom Notty.(I.char ~attr:(A.bg color) ' ' 1 size) in
let mouse_handler ~x:_ ~y = function
| `Left ->
if y < prefix then