mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-09-13 23:47:39 +03:00
refactor: switch to libadwaita
This commit is contained in:
parent
85d63ff9b2
commit
ba57aefd4b
530
Cargo.lock
generated
530
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@ homedir = "0.3.4"
|
||||
native-tls = "0.2.14"
|
||||
clap = { version = "4.5.36", features = ["derive"] }
|
||||
serde = { version = "1.0.219", features = ["serde_derive"] }
|
||||
gtk4 = { version = "0.9.6", optional = true }
|
||||
# gtk4 = { version = "0.9.6", optional = true }
|
||||
chrono = "0.4.40"
|
||||
serde_default = "0.2.0"
|
||||
socks = "0.3.4"
|
||||
@ -22,13 +22,14 @@ gdk-pixbuf = { version = "0.3.0", optional = true } # DO NOT UPDATE
|
||||
winapi = { version = "0.3.9", optional = true, features = ["wincon", "winuser"] }
|
||||
tungstenite = "0.27.0"
|
||||
reqwest = { version = "0.12.20", features = ["blocking"] }
|
||||
libadwaita = { version = "0.8.0", optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
winresource = { version = "0.1.20", optional = true }
|
||||
|
||||
[features]
|
||||
default = ["gtk"]
|
||||
gtk = ["dep:gtk4"]
|
||||
gtk = ["dep:libadwaita"]
|
||||
libnotify = ["dep:libnotify", "dep:gdk-pixbuf"]
|
||||
notify-rust = ["dep:notify-rust"]
|
||||
winapi = ["dep:winapi", "dep:winresource"]
|
||||
|
@ -12,23 +12,25 @@ use std::time::{Duration, SystemTime};
|
||||
|
||||
use chrono::Local;
|
||||
|
||||
use gtk4::gdk_pixbuf::InterpType;
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::gdk::{Cursor, Display, Texture};
|
||||
use gtk::gdk_pixbuf::{Pixbuf, PixbufAnimation, PixbufLoader};
|
||||
use gtk::gio::{self, ActionEntry, ApplicationFlags, MemoryInputStream, Menu};
|
||||
use gtk::glib::clone;
|
||||
use gtk::glib::{
|
||||
use libadwaita as adw;
|
||||
use adw::gdk::{Cursor, Display, Texture};
|
||||
use adw::gio::{self, ActionEntry, ApplicationFlags, MemoryInputStream, Menu};
|
||||
use adw::glib::clone;
|
||||
use adw::glib::{
|
||||
self, clone::Downgrade, source::timeout_add_local_once, timeout_add_local, timeout_add_once,
|
||||
ControlFlow,
|
||||
};
|
||||
use adw::prelude::*;
|
||||
use adw::{Application, ApplicationWindow, Window};
|
||||
|
||||
use adw::gtk;
|
||||
use gtk::gdk_pixbuf::InterpType;
|
||||
use gtk::gdk_pixbuf::{Pixbuf, PixbufAnimation, PixbufLoader};
|
||||
use gtk::pango::WrapMode;
|
||||
use gtk::prelude::*;
|
||||
use gtk::{
|
||||
AboutDialog, Align, Application, ApplicationWindow, Box as GtkBox, Button, Calendar,
|
||||
AboutDialog, Align, Box as GtkBox, Button, Calendar,
|
||||
CheckButton, CssProvider, Entry, Fixed, GestureClick, Justification, Label, ListBox,
|
||||
Orientation, Overlay, Picture, ScrolledWindow, Settings, Window,
|
||||
Orientation, Overlay, Picture, ScrolledWindow, Settings,
|
||||
};
|
||||
|
||||
use crate::chat::grab_avatar;
|
||||
@ -397,7 +399,7 @@ fn open_settings(ctx: Arc<Context>, app: &Application) {
|
||||
.default_height(500)
|
||||
.resizable(true)
|
||||
.decorated(true)
|
||||
.child(&vbox)
|
||||
.content(&vbox)
|
||||
.build();
|
||||
|
||||
let controller = gtk::EventControllerKey::new();
|
||||
@ -736,7 +738,7 @@ fn build_ui(ctx: Arc<Context>, app: &Application) -> UiModel {
|
||||
.resizable(true)
|
||||
.decorated(true)
|
||||
.show_menubar(true)
|
||||
.child(&main_box)
|
||||
.content(&main_box)
|
||||
.build();
|
||||
|
||||
window.connect_default_width_notify({
|
||||
@ -954,7 +956,7 @@ fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str)
|
||||
time::UNIX_EPOCH,
|
||||
};
|
||||
|
||||
use gtk4::gio::Notification;
|
||||
use gtk::gio::Notification;
|
||||
|
||||
let mut hash = DefaultHasher::new();
|
||||
hash.write(title.as_bytes());
|
||||
|
@ -1,26 +1,30 @@
|
||||
.send-button, .send-text { border-radius: 0; }
|
||||
/* .send-button, .send-text { border-radius: 0; } */
|
||||
.calendar {
|
||||
transform: scale(0.6);
|
||||
margin: -35px;
|
||||
transform: scale(0.6);
|
||||
margin: -35px;
|
||||
}
|
||||
|
||||
.widget_box {
|
||||
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.20);
|
||||
border-bottom: 2px solid rgba(0, 0, 0, 0.20);
|
||||
min-height: 121px;
|
||||
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.20);
|
||||
border-bottom: 2px solid rgba(0, 0, 0, 0.20);
|
||||
min-height: 121px;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 20px;
|
||||
font-family: monospace;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
font-family: monospace;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.message-avatar {
|
||||
border-radius: 64px;
|
||||
border-radius: 64px;
|
||||
}
|
||||
|
||||
/* Now made with GTK Pango Markup */
|
||||
|
||||
.message-name { font-weight: bold; }
|
||||
.message-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* .message-name-green { color: #70fa7a; }
|
||||
.message-name-red { color: #fa7070; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user