mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-06-24 19:02:58 +03:00
lfs
This commit is contained in:
parent
d390c1f28b
commit
89147235dc
@ -2,6 +2,7 @@ use std::sync::{mpsc::{channel, Receiver}, Arc, RwLock};
|
|||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::time::{Duration, SystemTime};
|
use std::time::{Duration, SystemTime};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
use std::error::Error;
|
||||||
|
|
||||||
use chrono::Local;
|
use chrono::Local;
|
||||||
|
|
||||||
@ -54,11 +55,11 @@ pub fn add_chat_message(ctx: Arc<Context>, message: String) {
|
|||||||
let _ = ctx.sender.read().unwrap().clone().unwrap().send((message, false));
|
let _ = ctx.sender.read().unwrap().clone().unwrap().send((message, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_pixbuf(data: &[u8]) -> Pixbuf {
|
fn load_pixbuf(data: &[u8]) -> Result<Pixbuf, Box<dyn Error>> {
|
||||||
let loader = PixbufLoader::new();
|
let loader = PixbufLoader::new();
|
||||||
loader.write(data).unwrap();
|
loader.write(data)?;
|
||||||
loader.close().unwrap();
|
loader.close()?;
|
||||||
loader.pixbuf().unwrap()
|
Ok(loader.pixbuf().ok_or("laod pixbuf error")?)
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! gui_entry_setting {
|
macro_rules! gui_entry_setting {
|
||||||
@ -380,7 +381,7 @@ fn build_menu(ctx: Arc<Context>, app: &Application) {
|
|||||||
.comments("better RAC client")
|
.comments("better RAC client")
|
||||||
.website("https://github.com/MeexReay/bRAC")
|
.website("https://github.com/MeexReay/bRAC")
|
||||||
.website_label("source code")
|
.website_label("source code")
|
||||||
.logo(&Texture::for_pixbuf(&load_pixbuf(include_bytes!("images/icon.png"))))
|
.logo(&Texture::for_pixbuf(&load_pixbuf(include_bytes!("images/icon.png")).unwrap()))
|
||||||
.build()
|
.build()
|
||||||
.present();
|
.present();
|
||||||
}
|
}
|
||||||
@ -448,14 +449,14 @@ fn build_ui(ctx: Arc<Context>, app: &Application) -> UiModel {
|
|||||||
let fixed = Fixed::new();
|
let fixed = Fixed::new();
|
||||||
fixed.set_can_target(false);
|
fixed.set_can_target(false);
|
||||||
|
|
||||||
let konata = Picture::for_pixbuf(&load_pixbuf(include_bytes!("images/konata.png")));
|
let konata = Picture::for_pixbuf(&load_pixbuf(include_bytes!("images/konata.png")).unwrap());
|
||||||
konata.set_size_request(174, 127);
|
konata.set_size_request(174, 127);
|
||||||
|
|
||||||
fixed.put(&konata, 325.0, 4.0);
|
fixed.put(&konata, 325.0, 4.0);
|
||||||
|
|
||||||
let logo_gif = include_bytes!("images/logo.gif");
|
let logo_gif = include_bytes!("images/logo.gif");
|
||||||
|
|
||||||
let logo = Picture::for_pixbuf(&load_pixbuf(logo_gif));
|
let logo = Picture::for_pixbuf(&load_pixbuf(logo_gif).unwrap());
|
||||||
logo.set_size_request(152, 64);
|
logo.set_size_request(152, 64);
|
||||||
|
|
||||||
let logo_anim = PixbufAnimation::from_stream(
|
let logo_anim = PixbufAnimation::from_stream(
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 30 KiB |
Binary file not shown.
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 24 KiB |
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user