mirror of
https://github.com/reynir/banawa-chat.git
synced 2024-11-23 21:37:54 +00:00
Minor changes to Window
We don't use position, and we don't calculate width yet.
This commit is contained in:
parent
fdbc198939
commit
1724e5c994
|
@ -1,7 +1,7 @@
|
||||||
open Nottui
|
open Nottui
|
||||||
open Notty
|
open Notty
|
||||||
|
|
||||||
type t = { w : int; h : int; p : int }
|
type t = { w : int; h : int; }
|
||||||
|
|
||||||
let render_message ~width ~width_nicknames msg =
|
let render_message ~width ~width_nicknames msg =
|
||||||
(* (* FIXME: split doesn't work *)
|
(* (* FIXME: split doesn't work *)
|
||||||
|
@ -9,6 +9,7 @@ let render_message ~width ~width_nicknames msg =
|
||||||
max 1 (width - width_nicknames - 1)
|
max 1 (width - width_nicknames - 1)
|
||||||
in
|
in
|
||||||
let message = Message.split_at ~len:width_message msg in *)
|
let message = Message.split_at ~len:width_message msg in *)
|
||||||
|
let _ = width in
|
||||||
let message = [Message.message msg] in
|
let message = [Message.message msg] in
|
||||||
let color = A.white in
|
let color = A.white in
|
||||||
let rest =
|
let rest =
|
||||||
|
@ -33,8 +34,8 @@ let width_nicknames msgs =
|
||||||
let f msg acc = max (String.length (Message.nickname msg)) acc in
|
let f msg acc = max (String.length (Message.nickname msg)) acc in
|
||||||
Rb.iter ~f msgs 0
|
Rb.iter ~f msgs 0
|
||||||
|
|
||||||
let render { w; h; p } msgs =
|
let render { w; h } msgs =
|
||||||
let idx = ref (Rb.length msgs - 1 - p) in
|
let idx = ref (Rb.length msgs - 1) in
|
||||||
let image = ref I.empty in
|
let image = ref I.empty in
|
||||||
let message = ref I.empty in
|
let message = ref I.empty in
|
||||||
let width_nicknames = width_nicknames msgs in
|
let width_nicknames = width_nicknames msgs in
|
||||||
|
|
Loading…
Reference in a new issue