feat: ✨ base project structure
This commit is contained in:
parent
e2043f1009
commit
1567a9c32a
15 changed files with 5568 additions and 1 deletions
42
client/src/gui.rs
Normal file
42
client/src/gui.rs
Normal file
|
@ -0,0 +1,42 @@
|
|||
use iced::{
|
||||
Alignment::Center,
|
||||
Element, Task, Theme,
|
||||
widget::{button, column, text},
|
||||
};
|
||||
|
||||
use crate::{ClientConfig, stream::connect};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Message {
|
||||
JoinRoom,
|
||||
LeaveRoom,
|
||||
MuteMicrophone,
|
||||
UnmuteMicrophone,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Data {
|
||||
client_config: Option<ClientConfig>,
|
||||
}
|
||||
|
||||
impl Data {
|
||||
pub fn update(&mut self, message: Message) -> Task<Message> {
|
||||
match message {
|
||||
Message::JoinRoom => Task::none(),
|
||||
Message::LeaveRoom => Task::none(),
|
||||
Message::MuteMicrophone => Task::none(),
|
||||
Message::UnmuteMicrophone => Task::none(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn view(&self) -> Element<'_, Message> {
|
||||
column![button("Join Room"), text("Hello").size(50)]
|
||||
.padding(10)
|
||||
.align_x(Center)
|
||||
.into()
|
||||
}
|
||||
|
||||
pub fn theme(&self) -> Theme {
|
||||
Theme::Dark
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue