@@ -21,61 +21,63 @@ module ViewConversations =
2121 AnyView(
2222 TextBlock("No contacts yet. Tap + to add one.")
2323 .centerText()
24− .foreground(SolidColorBrush(Colors.Gray))
24+ .foreground (SolidColorBrush(Colors.Gray))
2525 )
2626 else
27− AnyView(ListBox(
28− contacts,
29− fun c ->
30− let name = contactName model.Contacts c.Pubkey
27+ AnyView(
28+ ListBox(
29+ contacts,
30+ fun c ->
31+ let name = contactName model.Contacts c.Pubkey
3132
32− let preview =
33− messagesFor c.Pubkey model.Messages
34− |> List.tryLast
35− |> Option.map (fun m -> if m.Body.Length > 40 then m.Body.[..39] + "..." else m.Body)
36− |> Option.defaultValue ""
33+ let preview =
34+ messagesFor c.Pubkey model.Messages
35+ |> List.tryLast
36+ |> Option.map (fun m -> if m.Body.Length > 40 then m.Body.[..39] + "..." else m.Body)
37+ |> Option.defaultValue ""
3738
38− Border(
39− (HStack(8.) {
39+ Border(
40+ (HStack(8.) {
4041
41− Grid() {
42− (match c.Photo with
43− | None -> Image("avares://Skrepka/Assets/Images/user.png", Stretch.Uniform)
44− | Some i -> Image(cachedBitmap i, Stretch.UniformToFill))
45− .width(16.)
46− .height(16.)
47− .margin(8.)
48− .clipToBounds (true)
42+ Grid() {
43+ (match c.Photo with
44+ | None -> Image("avares://Skrepka/Assets/Images/user.png", Stretch.Uniform)
45+ | Some i -> Image(cachedBitmap i, Stretch.UniformToFill))
46+ .width(16.)
47+ .height(16.)
48+ .margin(8.)
49+ .clipToBounds (true)
4950
50− Rectangle().stroke(Colors.Black).strokeThickness (4.)
51− }
51+ Rectangle().stroke(Colors.Black).strokeThickness (4.)
52+ }
5253
53− VStack(2.) {
54− TextBlock(name)
55− .fontFamily(Constants.fontFamily)
56− .fontWeight(FontWeight.Bold)
57− .fontSize (16.)
54+ VStack(2.) {
55+ TextBlock(name)
56+ .fontFamily(Constants.fontFamily)
57+ .fontWeight(FontWeight.Bold)
58+ .fontSize (16.)
5859
59− if preview <> "" then
60− TextBlock(preview).fontSize(12.).fontWeight (FontWeight.Bold)
61− }
60+ if preview <> "" then
61+ TextBlock(preview).fontSize(12.).fontWeight (FontWeight.Bold)
62+ }
6263
63− })
64− .margin (8.)
65− )
66− .borderThickness(Avalonia.Thickness(0., 0., 0., 4.))
67− .borderBrush(SolidColorBrush(Colors.Black))
68− .background(Colors.Transparent)
69− .onTapped (fun _ -> SetPage(Chat(c.Pubkey, "")))
64+ })
65+ .margin (8.)
66+ )
67+ .borderThickness(Avalonia.Thickness(0., 0., 0., 4.))
68+ .borderBrush(SolidColorBrush(Colors.Black))
69+ .background(Colors.Transparent)
70+ .onTapped (fun _ -> SetPage(Chat(c.Pubkey, "")))
71+ )
72+ .styles(noListBoxPadding ())
73+ .background (Colors.White)
7074 )
71− .styles(noListBoxPadding ())
72− .background(Colors.White))
7375
7476 let bar =
75− (Grid([ Dimension.Auto; Dimension.Star; Dimension.Auto ], [Dimension.Auto]) {
77+ (Grid([ Dimension.Auto; Dimension.Star; Dimension.Auto ], [ Dimension.Auto ]) {
7678 (smallImageButton None (SetPage Settings)).gridColumn (0)
7779 (textField "" Search).margin(8.).verticalAlignment(VerticalAlignment.Stretch).gridColumn (1)
78− (smallTextButton "+" (SetPage(AddContact("", "")))).gridColumn (2)
80+ (smallTextButton "+" (SetPage(AddContact("")))).gridColumn (2)
7981 })
8082 // .margin(20.)
8183 .horizontalAlignment (HorizontalAlignment.Stretch)