disable gtk as default

This commit is contained in:
MeexReay 2025-04-16 02:24:13 +03:00
parent c1f6afe563
commit 6e5d050de3
3 changed files with 19 additions and 9 deletions

View File

@ -18,7 +18,7 @@ gtk4 = { version = "0.9.6", optional = true }
cfg-if = "1.0.0" cfg-if = "1.0.0"
[features] [features]
default = ["ssl", "homedir", "gtk_gui"] default = ["ssl", "homedir", "pretty_tui"]
ssl = ["dep:native-tls"] ssl = ["dep:native-tls"]
pretty_tui = ["dep:crossterm"] pretty_tui = ["dep:crossterm"]
gtk_gui = ["dep:gtk4"] gtk_gui = ["dep:gtk4"]

View File

@ -49,6 +49,12 @@ Minimal version:
cargo build --release --no-default-features cargo build --release --no-default-features
cargo run --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 ### nix package
@ -66,6 +72,13 @@ nix build github:MeexReay/bRAC#bRAC-minimal
nix run 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 ## default config
get config path - `bRAC --config-path` \ get config path - `bRAC --config-path` \

View File

@ -32,11 +32,12 @@ struct UiModel {
chat_scrolled: ScrolledWindow chat_scrolled: ScrolledWindow
} }
thread_local!(
static GLOBAL: RefCell<Option<(UiModel, Receiver<String>)>> = RefCell::new(None);
);
pub fn add_chat_message(ctx: Arc<Context>, message: String) { pub fn add_chat_message(ctx: Arc<Context>, message: String) {
let _ = ctx.chat().sender.send(message); 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<Context>, message: String) -> Result<(), Box<dyn Error>> { pub fn print_message(ctx: Arc<Context>, message: String) -> Result<(), Box<dyn Error>> {
@ -460,8 +461,4 @@ pub fn run_main_loop(ctx: Arc<Context>) {
}); });
application.run(); application.run();
} }
thread_local!(
static GLOBAL: RefCell<Option<(UiModel, Receiver<String>)>> = RefCell::new(None);
);