Skip to content

Commit

Permalink
feat: add font size and font family and text line-height
Browse files Browse the repository at this point in the history
  • Loading branch information
JQiue committed Dec 24, 2023
1 parent 24f3f83 commit be740df
Show file tree
Hide file tree
Showing 35 changed files with 901 additions and 750 deletions.
27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chinglish",
"private": true,
"version": "0.3.1",
"version": "0.7.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -11,21 +11,24 @@
"tauri:build": "tauri build"
},
"dependencies": {
"@tauri-apps/api": "^1.4.0",
"@types/node": "^20.8.7",
"@tauri-apps/api": "^1.5.3",
"@vueuse/core": "^10.7.0",
"dayjs": "^1.11.10",
"naive-ui": "^2.34.4",
"naive-ui": "^2.36.0",
"tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql#v1",
"vfonts": "^0.0.3",
"vue": "^3.3.4",
"vue-router": "4",
"vuetify": "^3.3.16"
"vite-plugin-vuetify": "^2.0.1",
"vue": "^3.3.13",
"vue-router": "^4.2.5",
"vuetify": "^3.4.8"
},
"devDependencies": {
"@tauri-apps/cli": "^1.4.0",
"@vitejs/plugin-vue": "^4.2.3",
"typescript": "^5.0.2",
"vite": "^4.4.4",
"vue-tsc": "^1.8.5"
"@mdi/font": "^7.3.67",
"@tauri-apps/cli": "^1.5.9",
"@types/node": "^20.10.5",
"@vitejs/plugin-vue": "^4.5.2",
"typescript": "^5.3.3",
"vite": "^4.5.1",
"vue-tsc": "^1.8.26"
}
}
1,232 changes: 542 additions & 690 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2021"
tauri-build = { version = "1.4", features = [] }

[dependencies]
tauri = { version = "1.4", features = ["shell-open"] }
tauri = { version = "1.4", features = [ "system-tray", "path-all", "shell-open"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

Expand Down
Binary file modified src-tauri/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square107x107Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square142x142Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square150x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square284x284Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square30x30Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square310x310Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square44x44Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square71x71Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square89x89Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/icon.icns
Binary file not shown.
Binary file modified src-tauri/icons/icon.ico
Binary file not shown.
Binary file modified src-tauri/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

mod tray;

use tray::system_tray;

// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
Expand All @@ -11,6 +15,7 @@ fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet])
.plugin(tauri_plugin_sql::Builder::default().build())
.system_tray(system_tray())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
27 changes: 27 additions & 0 deletions src-tauri/src/tray.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use tauri::{CustomMenuItem, SystemTray, SystemTrayEvent, SystemTrayMenu, VERSION};

pub fn system_tray() -> SystemTray {
let quit = CustomMenuItem::new("quit".to_string(), "退出");
let tray_menu = SystemTrayMenu::new().add_item(quit);
let tray = SystemTray::new()
.with_tooltip(format!("{} {}", "Chinglish", VERSION).as_str())
.with_menu(tray_menu)
.on_event(|event| match event {
SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {
"quit" => {
std::process::exit(0);
}
_ => {}
},
SystemTrayEvent::LeftClick { .. } => {
println!("left")
}
SystemTrayEvent::RightClick { .. } => {
println!("right")
}
SystemTrayEvent::DoubleClick { .. } => {}
_ => todo!(),
});

return tray;
}
19 changes: 16 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,24 @@
"shell": {
"all": false,
"open": true
},
"path": {
"all": true
}
},
"bundle": {
"active": true,
"identifier": "com.chinglish",
"publisher": "USH2A",
"shortDescription": "Chinglish or English?",
"longDescription": "Chinglish or English?",
"icon": ["icons/icon.ico"],
"longDescription": "Chinglish",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
"windows": {
"allowDowngrades": true,
"certificateThumbprint": null,
Expand Down Expand Up @@ -55,6 +64,10 @@
"width": 800,
"height": 600
}
]
],
"systemTray": {
"iconPath": "icons/icon.ico",
"iconAsTemplate": true
}
}
}
15 changes: 14 additions & 1 deletion src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ const menuOptions: MenuOption[] = [
),
key: "read",
},
{
label: () =>
h(
RouterLink,
{
to: {
path: "rss",
},
},
{ default: () => "RSS" }
),
key: "rss",
},
{
label: () =>
h(
Expand All @@ -42,7 +55,7 @@ const menuOptions: MenuOption[] = [
},
},
{
default: () => "文章管理",
default: () => "文章",
}
),
key: "article",
Expand Down
Loading

0 comments on commit be740df

Please sign in to comment.