feat(Ui): Ui Update:
Restrict Ui, now it is more minimaly Add back and up buttons Add asynchrony by what you can search in Ui when it make operations
This commit is contained in:
1 parent
7f548a7cc3
commit
c2b42a2dd9
5 files changed
+391
-852
No files matched your search
Generated
+123
@@ -10,6 +10,7 @@ dependencies = [
|
||||
"dirs",
|
||||
"eframe",
|
||||
"egui",
|
||||
"egui_extras",
|
||||
"flate2",
|
||||
"futures",
|
||||
"mockito",
|
||||
@@ -46,6 +47,10 @@ name = "accesskit"
|
||||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74a4b14f3d99c1255dcba8f45621ab1a2e7540a0009652d33989005a4d0bfc6b"
|
||||
dependencies = [
|
||||
"enumn",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "accesskit_consumer"
|
||||
@@ -138,6 +143,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"getrandom 0.3.4",
|
||||
"once_cell",
|
||||
"serde",
|
||||
"version_check",
|
||||
"zerocopy",
|
||||
]
|
||||
@@ -1157,6 +1163,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "20930a432bbd57a6d55e07976089708d4893f3d556cf42a0d79e9e321fa73b10"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1204,6 +1211,7 @@ dependencies = [
|
||||
"epaint",
|
||||
"log",
|
||||
"nohash-hasher",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1241,6 +1249,19 @@ dependencies = [
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "egui_extras"
|
||||
version = "0.27.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b78779f35ded1a853786c9ce0b43fe1053e10a21ea3b23ebea411805ce41593"
|
||||
dependencies = [
|
||||
"egui",
|
||||
"enum-map",
|
||||
"log",
|
||||
"mime_guess2",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "egui_glow"
|
||||
version = "0.27.2"
|
||||
@@ -1270,6 +1291,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e4c3a552cfca14630702449d35f41c84a0d15963273771c6059175a803620f3f"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1287,6 +1309,27 @@ version = "1.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
|
||||
|
||||
[[package]]
|
||||
name = "enum-map"
|
||||
version = "2.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9"
|
||||
dependencies = [
|
||||
"enum-map-derive",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enum-map-derive"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enumflags2"
|
||||
version = "0.7.12"
|
||||
@@ -1308,6 +1351,17 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enumn"
|
||||
version = "0.1.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "epaint"
|
||||
version = "0.27.2"
|
||||
@@ -1322,6 +1376,7 @@ dependencies = [
|
||||
"log",
|
||||
"nohash-hasher",
|
||||
"parking_lot",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2461,6 +2516,18 @@ version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
||||
|
||||
[[package]]
|
||||
name = "mime_guess2"
|
||||
version = "2.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1706dc14a2e140dec0a7a07109d9a3d5890b81e85bd6c60b906b249a77adf0ca"
|
||||
dependencies = [
|
||||
"mime",
|
||||
"phf",
|
||||
"phf_shared",
|
||||
"unicase",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.8.9"
|
||||
@@ -2891,6 +2958,50 @@ version = "2.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
|
||||
|
||||
[[package]]
|
||||
name = "phf"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
|
||||
dependencies = [
|
||||
"phf_macros",
|
||||
"phf_shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_generator"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
|
||||
dependencies = [
|
||||
"phf_shared",
|
||||
"rand 0.8.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_macros"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216"
|
||||
dependencies = [
|
||||
"phf_generator",
|
||||
"phf_shared",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
"unicase",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_shared"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
|
||||
dependencies = [
|
||||
"siphasher",
|
||||
"unicase",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.16"
|
||||
@@ -3561,6 +3672,12 @@ version = "2.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
version = "0.4.12"
|
||||
@@ -4078,6 +4195,12 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicase"
|
||||
version = "2.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.24"
|
||||
|
||||
+2
-1
@@ -17,9 +17,10 @@ serde_json = "1.0"
|
||||
chrono = "0.4"
|
||||
rfd = "0.14"
|
||||
|
||||
# GUI - simplified for better compatibility
|
||||
# GUI
|
||||
eframe = { version = "0.27", features = ["default"] }
|
||||
egui = "0.27"
|
||||
egui_extras = { version = "0.27" }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.8"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 1.3 MiB |
+8
-47
@@ -1,9 +1,3 @@
|
||||
//! Rclone UI Manager — графический интерфейс для rclone.
|
||||
//!
|
||||
//! Приложение предоставляет кроссплатформенную GUI для управления удалёнными
|
||||
//! хранилищами rclone, просмотра файлов и выполнения операций копирования,
|
||||
//! синхронизации, перемещения.
|
||||
|
||||
mod rclone_install;
|
||||
mod operations;
|
||||
mod ui;
|
||||
@@ -11,26 +5,12 @@ mod ui;
|
||||
use eframe::egui;
|
||||
use egui::{FontData, FontDefinitions, FontFamily};
|
||||
|
||||
/// Точка входа в приложение.
|
||||
///
|
||||
/// Загружает иконку окна, подключает пользовательские шрифты (Sans.otf и NotoColorEmoji.ttf)
|
||||
/// и запускает нативное окно eframe с приложением RcloneUI.
|
||||
fn main() -> Result<(), eframe::Error> {
|
||||
// Попытка загрузить иконку окна из assets/icon.png
|
||||
let icon = std::fs::read("assets/icon.png")
|
||||
.ok()
|
||||
.and_then(|bytes| eframe::icon_data::from_png_bytes(&bytes).ok())
|
||||
.map(std::sync::Arc::new);
|
||||
|
||||
let mut viewport = egui::ViewportBuilder::default()
|
||||
let viewport = egui::ViewportBuilder::default()
|
||||
.with_inner_size([1200.0, 800.0])
|
||||
.with_min_inner_size([800.0, 600.0])
|
||||
.with_title("Rclone UI Manager");
|
||||
|
||||
if let Some(icon) = icon {
|
||||
viewport = viewport.with_icon(icon);
|
||||
}
|
||||
|
||||
let options = eframe::NativeOptions {
|
||||
viewport,
|
||||
..Default::default()
|
||||
@@ -40,41 +20,22 @@ fn main() -> Result<(), eframe::Error> {
|
||||
"Rclone UI Manager",
|
||||
options,
|
||||
Box::new(|cc| {
|
||||
// Настройка пользовательских шрифтов
|
||||
let mut fonts = FontDefinitions::default();
|
||||
|
||||
// 1. Основной шрифт без засечек (Sans.otf) делаем шрифтом по умолчанию для пропорционального текста.
|
||||
|
||||
if let Ok(font_data) = std::fs::read("assets/fonts/Sans.otf") {
|
||||
fonts.font_data.insert(
|
||||
"sans".to_owned(),
|
||||
FontData::from_owned(font_data),
|
||||
);
|
||||
if let Some(proportional) = fonts.families.get_mut(&FontFamily::Proportional) {
|
||||
proportional.insert(0, "sans".to_owned());
|
||||
} else {
|
||||
fonts.families.insert(
|
||||
FontFamily::Proportional,
|
||||
vec!["sans".to_owned()],
|
||||
);
|
||||
}
|
||||
fonts.font_data.insert("sans".to_owned(), FontData::from_owned(font_data));
|
||||
fonts.families.entry(FontFamily::Proportional).or_default().insert(0, "sans".to_owned());
|
||||
}
|
||||
|
||||
// 2. Шрифт с эмодзи (NotoColorEmoji.ttf) подключаем как запасной.
|
||||
if let Ok(emoji_data) = std::fs::read("assets/fonts/NotoColorEmoji.ttf") {
|
||||
fonts.font_data.insert(
|
||||
"emoji".to_owned(),
|
||||
FontData::from_owned(emoji_data),
|
||||
);
|
||||
if let Some(proportional) = fonts.families.get_mut(&FontFamily::Proportional) {
|
||||
if !proportional.contains(&"emoji".to_owned()) {
|
||||
proportional.push("emoji".to_owned());
|
||||
}
|
||||
fonts.font_data.insert("emoji".to_owned(), FontData::from_owned(emoji_data));
|
||||
let prop = fonts.families.entry(FontFamily::Proportional).or_default();
|
||||
if !prop.contains(&"emoji".to_owned()) {
|
||||
prop.push("emoji".to_owned());
|
||||
}
|
||||
}
|
||||
|
||||
// Применяем настройки шрифтов к egui-контексту.
|
||||
cc.egui_ctx.set_fonts(fonts);
|
||||
|
||||
Box::new(ui::RcloneUI::new(cc))
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user