mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-05-06 13:38:04 +03:00
Merge branch 'main' of https://github.com/MeexReay/bRAC
This commit is contained in:
commit
904ac31a97
12
README.md
12
README.md
@ -39,21 +39,21 @@ cd bRAC
|
|||||||
|
|
||||||
3. Build or run with Cargo
|
3. Build or run with Cargo
|
||||||
```bash
|
```bash
|
||||||
cargo build --release # build release (target/release/bRAC)
|
cargo build -r # build release (target/release/bRAC)
|
||||||
cargo run --release # run (builds and runs bRAC itself)
|
cargo run -r # run (builds and runs bRAC itself)
|
||||||
```
|
```
|
||||||
|
|
||||||
Minimal version:
|
Minimal version:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo build --release --no-default-features
|
cargo build -r --no-default-features
|
||||||
cargo run --release --no-default-features
|
cargo run -r --no-default-features
|
||||||
```
|
```
|
||||||
GTK version:
|
GTK version:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo build --release --features gtk_gui
|
cargo build -rF gtk_gui
|
||||||
cargo run --release --features gtk_gui
|
cargo run -rF gtk_gui
|
||||||
```
|
```
|
||||||
|
|
||||||
### nix package
|
### nix package
|
||||||
|
@ -2,7 +2,7 @@ use std::sync::{Arc, RwLock};
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use colored::{Color, Colorize};
|
use colored::{Color, Colorize};
|
||||||
use gtk4::gdk::Display;
|
use gtk4::gdk::{Cursor, Display};
|
||||||
use gtk4::gdk_pixbuf::PixbufLoader;
|
use gtk4::gdk_pixbuf::PixbufLoader;
|
||||||
use gtk4::gio::MenuModel;
|
use gtk4::gio::MenuModel;
|
||||||
use gtk4::glib::clone::Downgrade;
|
use gtk4::glib::clone::Downgrade;
|
||||||
@ -110,12 +110,14 @@ fn build_ui(ctx: Arc<Context>, app: &Application) {
|
|||||||
|
|
||||||
let send_btn = Button::builder()
|
let send_btn = Button::builder()
|
||||||
.label("Send")
|
.label("Send")
|
||||||
|
.cursor(&Cursor::from_name("pointer", None).unwrap())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
send_btn.connect_clicked(clone!(
|
send_btn.connect_clicked(clone!(
|
||||||
#[weak] text_entry,
|
#[weak] text_entry,
|
||||||
#[weak] ctx,
|
#[weak] ctx,
|
||||||
move |_| {
|
move |_| {
|
||||||
|
if text_entry.text().is_empty() { return; }
|
||||||
idle_add_local_once(clone!(
|
idle_add_local_once(clone!(
|
||||||
#[weak] text_entry,
|
#[weak] text_entry,
|
||||||
move || {
|
move || {
|
||||||
@ -134,6 +136,7 @@ fn build_ui(ctx: Arc<Context>, app: &Application) {
|
|||||||
#[weak] text_entry,
|
#[weak] text_entry,
|
||||||
#[weak] ctx,
|
#[weak] ctx,
|
||||||
move |_| {
|
move |_| {
|
||||||
|
if text_entry.text().is_empty() { return; }
|
||||||
idle_add_local_once(clone!(
|
idle_add_local_once(clone!(
|
||||||
#[weak] text_entry,
|
#[weak] text_entry,
|
||||||
move || {
|
move || {
|
||||||
@ -271,16 +274,20 @@ fn load_css() {
|
|||||||
let provider = CssProvider::new();
|
let provider = CssProvider::new();
|
||||||
provider.load_from_data("
|
provider.load_from_data("
|
||||||
|
|
||||||
|
* {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.message-content {
|
.message-content {
|
||||||
color: #FFFFFF;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-date {
|
.message-date {
|
||||||
color: #AAAAAA;
|
color: #555555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-ip {
|
.message-ip {
|
||||||
color: #AAAAAA;
|
color: #777777;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-name {
|
.message-name {
|
||||||
@ -358,6 +365,10 @@ fn load_css() {
|
|||||||
&provider,
|
&provider,
|
||||||
gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION,
|
gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if let Some(settings) = gtk4::Settings::default() {
|
||||||
|
settings.set_gtk_application_prefer_dark_theme(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_add_message(ctx: Arc<Context>, ui: &UiModel, message: String) {
|
fn on_add_message(ctx: Arc<Context>, ui: &UiModel, message: String) {
|
||||||
|
Loading…
Reference in New Issue
Block a user