diff --git a/Cargo.toml b/Cargo.toml index 558e582..199c9a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ gtk4 = { version = "0.9.6", optional = true } cfg-if = "1.0.0" [features] -default = ["ssl", "homedir", "gtk_gui"] +default = ["ssl", "homedir", "pretty_tui"] ssl = ["dep:native-tls"] pretty_tui = ["dep:crossterm"] gtk_gui = ["dep:gtk4"] diff --git a/README.md b/README.md index f52b6e2..70a9900 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,12 @@ Minimal version: cargo build --release --no-default-features cargo run --release --no-default-features ``` +GTK version: + +```bash +cargo build --release --features gtk_gui +cargo run --release --features gtk_gui +``` ### nix package @@ -66,6 +72,13 @@ nix build github:MeexReay/bRAC#bRAC-minimal nix run github:MeexReay/bRAC#bRAC-minimal ``` +GTK version: + +```bash +nix build github:MeexReay/bRAC#bRAC-gtk +nix run github:MeexReay/bRAC#bRAC-gtk +``` + ## default config get config path - `bRAC --config-path` \ diff --git a/src/chat/gtk_gui.rs b/src/chat/gtk_gui.rs index df04f8f..e5b54ba 100644 --- a/src/chat/gtk_gui.rs +++ b/src/chat/gtk_gui.rs @@ -32,11 +32,12 @@ struct UiModel { chat_scrolled: ScrolledWindow } +thread_local!( + static GLOBAL: RefCell)>> = RefCell::new(None); +); + pub fn add_chat_message(ctx: Arc, message: String) { let _ = ctx.chat().sender.send(message); - // MainContext::default().invoke_local(move || { - // ctx.chat().chat_box.upgrade().unwrap().append(&Label::new(Some(message.as_str()))); - // }); } pub fn print_message(ctx: Arc, message: String) -> Result<(), Box> { @@ -460,8 +461,4 @@ pub fn run_main_loop(ctx: Arc) { }); application.run(); -} - -thread_local!( - static GLOBAL: RefCell)>> = RefCell::new(None); -); \ No newline at end of file +} \ No newline at end of file