🐛 调整结构/升级wry支持手势/flomo地址替换

This commit is contained in:
Tw93
2022-12-07 22:48:34 +08:00
parent f641f1c2b3
commit a871267007
22 changed files with 85 additions and 188 deletions

View File

@@ -8,10 +8,6 @@
![image-20221205230324046](assets/image-20221205230324046.png) ![image-20221205230324046](assets/image-20221205230324046.png)
## 3.修改 app.csv 文件 ## 3.修改 app.csv 文件
![image-20221205230432205](assets/image-20221205230432205.png) ![image-20221205230432205](assets/image-20221205230432205.png)
@@ -29,13 +25,11 @@
**注意:需要两个.ico 文件和一个.png 文件,参考下表** **注意:需要两个.ico 文件和一个.png 文件,参考下表**
| 文件名称 | 说明 | | 文件名称 | 说明 |
| ----------- | ---------------- | | ----------- | -------------------- |
| app_32.ico | 32*32ico图标 | | app_32.ico | 32\*32ico 图标 |
| app_256.ico | 256*256ico图标 | | app_256.ico | 256\*256ico 图标 |
| app_512.png | 512*512png图片 | | app_512.png | 512\*512png 图片 |
> 你也可以直接 git 整个项目到本地,使用项目根目录下的 icns2png.py 文件批量将.icns 文件转换成.ico 和.png 文件(.icns 文件是必须的) > 你也可以直接 git 整个项目到本地,使用项目根目录下的 icns2png.py 文件批量将.icns 文件转换成.ico 和.png 文件(.icns 文件是必须的)
> >

View File

@@ -8,10 +8,6 @@
![image-20221205230324046](assets/image-20221205230324046.png) ![image-20221205230324046](assets/image-20221205230324046.png)
## 3. Modify the app.csv file ## 3. Modify the app.csv file
![image-20221205230432205](assets/image-20221205230432205.png) ![image-20221205230432205](assets/image-20221205230432205.png)
@@ -29,13 +25,11 @@ The format is: `Linux application name, Mac and Windows application name, Chines
**Note: Two .ico files and one .png file are required, refer to the table below** **Note: Two .ico files and one .png file are required, refer to the table below**
| File Name | Description | | File Name | Description |
| ----------- | --------------------------------- | | ----------- | ---------------------------------- |
| app_32.ico | A ico file with a size of 32*32 | | app_32.ico | A ico file with a size of 32\*32 |
| app_256.ico | A ico file with a size of 256*256 | | app_256.ico | A ico file with a size of 256\*256 |
| app_512.png | A png file with a size of 512*512 | | app_512.png | A png file with a size of 512\*512 |
> You can also directly git the entire project to the local, and use the icns2png.py file in the project root directory to batch convert .icns files into .ico and .png files (.icns files are required) > You can also directly git the entire project to the local, and use the icns2png.py file in the project root directory to batch convert .icns files into .ico and .png files (.icns files are required)
> >

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -95,8 +95,6 @@
注意Windows 下不能安装到 `C:\Program File`,会直接闪退,建议安装到其他非管理员权限目录,比如 `D:\Program Files (x86)` 注意Windows 下不能安装到 `C:\Program File`,会直接闪退,建议安装到其他非管理员权限目录,比如 `D:\Program Files (x86)`
对于轻度使用用户,使用 **GitHub Actions 在线编译多系统版本** 也是一个不错的选择,可查看[文档](/docs/README.md)。
## 命令行打包 ## 命令行打包
<kbd> <kbd>
@@ -117,6 +115,8 @@ pake url [options]
pake https://weekly.tw93.fun --name Weekly --transparent pake https://weekly.tw93.fun --name Weekly --transparent
``` ```
假如你是不太会使用命令行的小白,使用 **GitHub Actions 在线编译多系统版本** 也是一个不错的选择,可查看[文档](./.github/workflows/docs/README.md)。
## 快捷键 ## 快捷键
| Mac | Windows/Linux | 功能 | | Mac | Windows/Linux | 功能 |

View File

@@ -94,8 +94,6 @@
</table> </table>
Note: it cannot be installed to C:\Program File under Windows, and it will crash directly. It is recommended to install to other non-administrator directories, such as D:\Program Files (x86) . Note: it cannot be installed to C:\Program File under Windows, and it will crash directly. It is recommended to install to other non-administrator directories, such as D:\Program Files (x86) .
Also for light users, a good option is to use **GitHub Actions online compilation**, see the [tutorial](/docs/README_EN.md).
## Command line packing ## Command line packing
<kbd> <kbd>
@@ -103,7 +101,7 @@ Also for light users, a good option is to use **GitHub Actions online compilatio
</kbd> </kbd>
<br/><br/> <br/><br/>
**Pake provides a command line tool that makes it quicker and easier to customize the packages you need, as detailed in [documentation](./bin/README_EN.md).** **Pake provides a command line tool that makes it quicker and easier to customize the packages you need, as detailed in [documentation](./.github/workflows/docs/README_EN.md).**
```bash ```bash
// Install with npm // Install with npm
@@ -116,6 +114,8 @@ pake url [options]
pake https://weekly.tw93.fun --name Weekly --transparent pake https://weekly.tw93.fun --name Weekly --transparent
``` ```
If you are a little white who doesn't know how to use the command line, a good option is to use **GitHub Actions online compilation**, see the [tutorial](/docs/README_EN.md).
## Shortcuts ## Shortcuts
| Mac | Windows/Linux | Function | | Mac | Windows/Linux | Function |

View File

@@ -4,6 +4,6 @@ youtube,YouTube,YouTube,https://youtube.com
reference,Reference,Reference,https://wangchujiang.com/reference/index.html reference,Reference,Reference,https://wangchujiang.com/reference/index.html
code,Code,Code,https://riju.codes/ code,Code,Code,https://riju.codes/
yuque,YuQue,语雀,https://www.yuque.com/ yuque,YuQue,语雀,https://www.yuque.com/
flomo,Flomo,浮墨,https://flomoapp.com/mine flomo,Flomo,浮墨,https://v.flomoapp.com/mine
qwerty,Qwerty,Qwerty,https://qwerty.kaiyi.cool/ qwerty,Qwerty,Qwerty,https://qwerty.kaiyi.cool/
weread,WeRead,微信阅读,https://weread.qq.com/ weread,WeRead,微信阅读,https://weread.qq.com/
1 name(Linux) name(Mac/Windows) name_zh url
4 reference Reference Reference https://wangchujiang.com/reference/index.html
5 code Code Code https://riju.codes/
6 yuque YuQue 语雀 https://www.yuque.com/
7 flomo Flomo 浮墨 https://flomoapp.com/mine https://v.flomoapp.com/mine
8 qwerty Qwerty Qwerty https://qwerty.kaiyi.cool/
9 weread WeRead 微信阅读 https://weread.qq.com/

View File

@@ -23,6 +23,7 @@
"start": "npm run dev", "start": "npm run dev",
"dev": "npm run tauri dev", "dev": "npm run tauri dev",
"dev:debug": "npm run tauri dev -- --features devtools", "dev:debug": "npm run tauri dev -- --features devtools",
"build": "npm run tauri build --release",
"build:release": "npm run tauri build --release", "build:release": "npm run tauri build --release",
"build:all-unix": "chmod +x ./script/build.sh && ./script/build.sh", "build:all-unix": "chmod +x ./script/build.sh && ./script/build.sh",
"build:all-windows": ".\\script\\build.bat", "build:all-windows": ".\\script\\build.bat",

142
src-tauri/Cargo.lock generated
View File

@@ -49,7 +49,7 @@ dependencies = [
"tauri-build", "tauri-build",
"tauri-utils", "tauri-utils",
"webbrowser", "webbrowser",
"wry 0.21.1", "wry 0.23.1",
] ]
[[package]] [[package]]
@@ -1262,20 +1262,6 @@ dependencies = [
"system-deps 5.0.0", "system-deps 5.0.0",
] ]
[[package]]
name = "jni"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec"
dependencies = [
"cesu8",
"combine",
"jni-sys",
"log",
"thiserror",
"walkdir",
]
[[package]] [[package]]
name = "jni" name = "jni"
version = "0.20.0" version = "0.20.0"
@@ -2474,52 +2460,6 @@ dependencies = [
"version-compare 0.1.1", "version-compare 0.1.1",
] ]
[[package]]
name = "tao"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43336f5d1793543ba96e2a1e75f3a5c7dcd592743be06a0ab3a190f4fcb4b934"
dependencies = [
"bitflags",
"cairo-rs",
"cc",
"cocoa",
"core-foundation",
"core-graphics",
"crossbeam-channel",
"dispatch",
"gdk",
"gdk-pixbuf",
"gdk-sys",
"gdkx11-sys",
"gio",
"glib",
"glib-sys",
"gtk",
"image",
"instant",
"jni 0.19.0",
"lazy_static",
"libc",
"log",
"ndk",
"ndk-context",
"ndk-sys",
"objc",
"once_cell",
"parking_lot",
"paste",
"png",
"raw-window-handle",
"scopeguard",
"serde",
"unicode-segmentation",
"uuid 1.2.2",
"windows 0.39.0",
"windows-implement",
"x11-dl",
]
[[package]] [[package]]
name = "tao" name = "tao"
version = "0.15.6" version = "0.15.6"
@@ -2544,7 +2484,7 @@ dependencies = [
"gtk", "gtk",
"image", "image",
"instant", "instant",
"jni 0.20.0", "jni",
"lazy_static", "lazy_static",
"libc", "libc",
"log", "log",
@@ -3149,7 +3089,7 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a0cc7962b5aaa0dfcebaeef0161eec6edf5f4606c12e6777fd7d392f52033a5" checksum = "2a0cc7962b5aaa0dfcebaeef0161eec6edf5f4606c12e6777fd7d392f52033a5"
dependencies = [ dependencies = [
"jni 0.20.0", "jni",
"ndk-context", "ndk-context",
"objc", "objc",
"raw-window-handle", "raw-window-handle",
@@ -3472,42 +3412,6 @@ dependencies = [
"toml", "toml",
] ]
[[package]]
name = "wry"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff5c1352b4266fdf92c63479d2f58ab4cd29dc4e78fbc1b62011ed1227926945"
dependencies = [
"base64",
"block",
"cocoa",
"core-graphics",
"crossbeam-channel",
"gdk",
"gio",
"glib",
"gtk",
"html5ever",
"http",
"kuchiki",
"libc",
"log",
"objc",
"objc_id",
"once_cell",
"serde",
"serde_json",
"sha2",
"tao 0.14.0",
"thiserror",
"url",
"webkit2gtk",
"webkit2gtk-sys",
"webview2-com",
"windows 0.39.0",
"windows-implement",
]
[[package]] [[package]]
name = "wry" name = "wry"
version = "0.22.5" version = "0.22.5"
@@ -3536,7 +3440,45 @@ dependencies = [
"serde_json", "serde_json",
"sha2", "sha2",
"soup2", "soup2",
"tao 0.15.6", "tao",
"thiserror",
"url",
"webkit2gtk",
"webkit2gtk-sys",
"webview2-com",
"windows 0.39.0",
"windows-implement",
]
[[package]]
name = "wry"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a76c9236a810d4af02213f89f5bc55bf3262d40c4407b13a9fc847156ef8b856"
dependencies = [
"base64",
"block",
"cocoa",
"core-graphics",
"crossbeam-channel",
"dunce",
"gdk",
"gio",
"glib",
"gtk",
"html5ever",
"http",
"kuchiki",
"libc",
"log",
"objc",
"objc_id",
"once_cell",
"serde",
"serde_json",
"sha2",
"soup2",
"tao",
"thiserror", "thiserror",
"url", "url",
"webkit2gtk", "webkit2gtk",

View File

@@ -21,7 +21,7 @@ tauri = { version = "1.2.1", features = [] }
image = "0.24.5" image = "0.24.5"
tauri-utils = "1.2.1" tauri-utils = "1.2.1"
webbrowser = "0.8.2" webbrowser = "0.8.2"
wry = "0.21.1" wry = "0.23.1"
[features] [features]
# by default Tauri runs in production mode # by default Tauri runs in production mode

View File

@@ -177,12 +177,11 @@ fn main() -> wry::Result<()> {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
let webview = WebViewBuilder::new(window)? let webview = WebViewBuilder::new(window)?
// .with_user_agent(user_agent_string) // .with_user_agent(user_agent_string)
// .with_accept_first_mouse(true)
.with_url(&url.to_string())? .with_url(&url.to_string())?
.with_devtools(cfg!(feature = "devtools")) .with_devtools(cfg!(feature = "devtools"))
.with_initialization_script(include_str!("pake.js")) .with_initialization_script(include_str!("pake.js"))
.with_ipc_handler(handler) .with_ipc_handler(handler)
// .with_back_forward_navigation_gestures(true) .with_back_forward_navigation_gestures(true)
.build()?; .build()?;
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
@@ -193,7 +192,6 @@ fn main() -> wry::Result<()> {
.with_devtools(cfg!(feature = "devtools")) .with_devtools(cfg!(feature = "devtools"))
.with_initialization_script(include_str!("pake.js")) .with_initialization_script(include_str!("pake.js"))
.with_ipc_handler(handler) .with_ipc_handler(handler)
// .with_back_forward_navigation_gestures(true)
.build()?; .build()?;
// 自定义cookie文件夹仅用于Linux // 自定义cookie文件夹仅用于Linux
// Custom Cookie folder, only for Linux // Custom Cookie folder, only for Linux
@@ -211,13 +209,11 @@ fn main() -> wry::Result<()> {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
let webview = WebViewBuilder::new(window)? let webview = WebViewBuilder::new(window)?
// .with_user_agent(user_agent_string) // .with_user_agent(user_agent_string)
// .with_accept_first_mouse(true)
.with_url(&url.to_string())? .with_url(&url.to_string())?
.with_devtools(cfg!(feature = "devtools")) .with_devtools(cfg!(feature = "devtools"))
.with_initialization_script(include_str!("pake.js")) .with_initialization_script(include_str!("pake.js"))
.with_ipc_handler(handler) .with_ipc_handler(handler)
.with_web_context(&mut web_content) .with_web_context(&mut web_content)
// .with_back_forward_navigation_gestures(true)
.build()?; .build()?;
#[cfg(feature = "devtools")] #[cfg(feature = "devtools")]

View File

@@ -1,30 +0,0 @@
{
"package": {
"productName": "WeRead",
"version": "1.0.0"
},
"tauri": {
"windows": [
{
"url": "https://weread.qq.com/",
"transparent": true,
"fullscreen": false,
"width": 1200,
"height": 728,
"resizable": true
}
],
"security": {
"csp": null
},
"updater": {
"active": false
}
},
"build": {
"devPath": "../dist",
"distDir": "../dist",
"beforeBuildCommand": "",
"beforeDevCommand": ""
}
}