api deserialization, sidebars

This commit is contained in:
Margret Riegert
2026-03-20 02:43:24 -04:00
parent 505cc110aa
commit bdeda666c1
7 changed files with 265 additions and 21 deletions

View File

@@ -1,32 +1,50 @@
import { Button, VerticalBox, TextEdit } from "std-widgets.slint";
import { ChatView } from "chat-view.slint";
import { ChannelSidebar, ServerSidebar } from "sidebar.slint";
export component AppWindow inherits Window {
title: "ermine";
VerticalLayout {
property <bool> sidebar-open: true;
ChatView {
messages: [
{ text: "hello", sender: "Bob", time: "10:00" },
{ text: "hey!", sender: "Joe", time: "10:01" },
{ text: "i like cats c:", sender: "Bob", time: "10:03" },
{ text: "me too c:", sender: "Joe", time: "10:08" },
{
text: "meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow ",
sender: "Joe",
time: "10:08"
},
{
text: "meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow ",
sender: "Bob",
time: "10:12"
},
];
HorizontalLayout {
ServerSidebar {
open: root.width > 600px;
server_list: [{ icon: "😳" }, { icon: "😍" }];
background: yellow;
}
TextEdit {
height: 64px;
font-size: 16px;
ChannelSidebar {
open: root.width > 600px ? sidebar-open : false;
channel_list: [{ title: "Foo" }, { title: "Bar" }];
background: blue;
}
VerticalLayout {
ChatView {
messages: [
{ text: "hello", sender: "Bob", time: "10:00" },
{ text: "hey!", sender: "Joe", time: "10:01" },
{ text: "i like cats c:", sender: "Bob", time: "10:03" },
{ text: "me too c:", sender: "Joe", time: "10:08" },
{
text: "meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow ",
sender: "Joe",
time: "10:08"
},
{
text: "meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow meow ",
sender: "Bob",
time: "10:12"
},
];
}
TextEdit {
height: 64px;
font-size: 16px;
}
}
}
}