Initial commit.
This commit is contained in:
25
mlc-client/src/screens/chats.rs
Normal file
25
mlc-client/src/screens/chats.rs
Normal file
@ -0,0 +1,25 @@
|
||||
use egui::{ComboBox, Label, SidePanel, Ui, Widget};
|
||||
|
||||
use crate::ctx::ClientCTX;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct ChatsScreen {
|
||||
chats: Vec<String>,
|
||||
selected_chat: Option<String>,
|
||||
}
|
||||
|
||||
impl ChatsScreen {
|
||||
pub fn update(&mut self, egui_ctx: &egui::Context, ctx: &mut ClientCTX, ui: &mut Ui) {
|
||||
SidePanel::new(egui::panel::Side::Left, "chats_list")
|
||||
.resizable(false)
|
||||
.show_inside(ui, |ui| {
|
||||
for chat in &self.chats {
|
||||
let label = Label::new(format!("{}", chat)).ui(ui);
|
||||
if label.clicked() {
|
||||
self.selected_chat = Some(format!("Chat {}", chat));
|
||||
}
|
||||
}
|
||||
});
|
||||
ui.label(&format!("Chat : {:?}", self.selected_chat));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user