Skip to content

Commit

Permalink
chore: change name and ico
Browse files Browse the repository at this point in the history
  • Loading branch information
zu1k committed Nov 22, 2022
1 parent 0b887c0 commit cfc27d1
Show file tree
Hide file tree
Showing 13 changed files with 493 additions and 897 deletions.
1,242 changes: 374 additions & 868 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "copy-translator"
version = "0.4.1"
name = "translator"
version = "0.4.2"
edition = "2021"
build = "build.rs"

Expand All @@ -11,24 +11,24 @@ opt-level = "s"
codegen-units = 1

[dependencies]
cli-clipboard = "0.2"
cli-clipboard = "0.3"
cfg-if = "1"
config = "0.13"
deepl = { package = "deepl-api-client", version = "0.2" }
eframe = "0.19"
egui = "0.19"
lazy_static = "1.4"
log = "0.4"
ico = "0.1"
rdev = { git = "https://github.com/asur4s/rdev", branch = "master" }
ico = "0.2"
rdev = "0.5"
tauri-hotkey = { git = "https://github.com/zu1k/tauri-hotkey-rs", branch = "master" }

[build-dependencies]
winres = "0.1"

[package.metadata.winres]
OriginalFilename = "copy-translator.exe"
OriginalFilename = "translator.exe"
LegalCopyright = "Copyright © 2021-2022 zu1k"
ProductName = "CopyTranslator"
ProductVersion = "0.4.1"
FileDescription = "CopyTranslator: 简单、轻量、好用的划词翻译软件"
ProductName = "Translator"
ProductVersion = "0.4.2"
FileDescription = "Translator: 简单、轻量、好用的划词翻译软件"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copy Translator
# Translator

Copy Translator 是使用Rust编写的翻译小工具
Translator 是使用Rust编写的翻译小工具

## 特点

Expand All @@ -18,6 +18,6 @@ Copy Translator 是使用Rust编写的翻译小工具

## Copyright

**Copy Translator** © [zu1k](https://github.com/zu1k), Copyright reserved.<br>
**Translator** © [zu1k](https://github.com/zu1k), Copyright reserved.<br>

> Blog [zu1k.com](https://zu1k.com) · GitHub [@zu1k](https://github.com/zu1k) · Twitter [@zu1k_lv](https://twitter.com/zu1k_lv) · Telegram Channel [@peekfun](https://t.me/peekfun)
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() {
.set_windres_path("x86_64-w64-mingw32-windres");
}
}
res.set_icon("res/copy-translator.ico").set_language(0x04);
res.set_icon("res/translator.ico").set_language(0x04);
res.compile().unwrap();
}
}
10 changes: 0 additions & 10 deletions res/copy-translator.desktop

This file was deleted.

Binary file removed res/copy-translator.ico
Binary file not shown.
10 changes: 10 additions & 0 deletions res/translator.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Translator
Comment=Translator
GenericName=Translator
Keywords=Translator;
Exec=translator
Icon=/usr/share/pixmaps/translator.ico
Terminal=false
Type=Application
Categories=Utility;
Binary file added res/translator.ico
Binary file not shown.
90 changes: 90 additions & 0 deletions res/translator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lazy_static! {

pub fn init_config() {
#[cfg(not(target_os = "windows"))]
let settings_path = std::path::PathBuf::from("/etc/copy-translator/settings");
let settings_path = std::path::PathBuf::from("/etc/translator/settings");

#[cfg(target_os = "windows")]
let settings_path = {
Expand Down
6 changes: 3 additions & 3 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl eframe::App for MyApp {
ui.visuals_mut().hyperlink_color = state.link_color;
ui.hyperlink_to(
egui::special_emojis::GITHUB.to_string(),
"https://github.com/zu1k/copy-translator",
"https://github.com/zu1k/translator",
);

if ui.add(egui::Button::new("□").frame(false)).clicked() {
Expand Down Expand Up @@ -190,9 +190,9 @@ impl eframe::App for MyApp {
}

pub fn get_icon_data() -> eframe::IconData {
let ioc_buf = Cursor::new(include_bytes!("../res/copy-translator.ico"));
let ioc_buf = Cursor::new(include_bytes!("../res/translator.ico"));
let icon_dir = ico::IconDir::read(ioc_buf).unwrap();
let image = icon_dir.entries()[5].decode().unwrap();
let image = icon_dir.entries()[0].decode().unwrap();
eframe::IconData {
rgba: std::vec::Vec::from(image.rgba_data()),
width: image.width(),
Expand Down
2 changes: 1 addition & 1 deletion src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,5 @@ pub fn run() {
drag_and_drop_support: true,
..Default::default()
};
eframe::run_native("Copy Translator", native_options, Box::new(setup_ui_task));
eframe::run_native("Translator", native_options, Box::new(setup_ui_task));
}
2 changes: 1 addition & 1 deletion src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,5 @@ fn launch_window() {
run_and_return: true,
..Default::default()
};
eframe::run_native("Copy Translator", native_options, Box::new(setup_ui_task));
eframe::run_native("Translator", native_options, Box::new(setup_ui_task));
}

0 comments on commit cfc27d1

Please sign in to comment.