支持双击全屏切换和新应用runcode

This commit is contained in:
Tw93
2022-10-18 11:35:13 +08:00
parent 383d59fb28
commit afbf9ace10
5 changed files with 69 additions and 65 deletions

View File

@@ -21,37 +21,36 @@
5. `command + r`:刷新页面 5. `command + r`:刷新页面
6. `command + w`:隐藏窗口,非退出 6. `command + w`:隐藏窗口,非退出
此外还支持双击头部进行全屏切换,拖拽头部进行移动窗口,还有其他需求,欢迎提过来。
## 效果 ## 效果
### 微信读书 <table>
<tr>
下载地址:<https://github.com/tw93/Pake/raw/master/download/WeRead.dmg> <td>WeRead <a href="https://github.com/tw93/Pake/raw/master/download/WeRead.dmg">Download</a></td>
<td>Flomo <a href="https://github.com/tw93/Pake/raw/master/download/Flomo.dmg">Download</a></td>
![1](https://cdn.fliggy.com/upic/ffUmdj.png) </tr>
<tr>
### Flomo <td><img src=https://cdn.fliggy.com/upic/ffUmdj.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/B49SAc.png width=600/></td>
下载地址:<https://github.com/tw93/Pake/raw/master/download/Flomo.dmg> </tr>
<tr>
![2](https://cdn.fliggy.com/upic/B49SAc.png) <td>RunCode <a href="https://github.com/tw93/Pake/raw/master/download/RunCode.dmg">Download</a></td>
<td>Witeboard <a href="https://github.com/tw93/Pake/raw/master/download/Witeboard.dmg">Download</a></td>
### Witeboard </tr>
<tr>
下载地址:<https://github.com/tw93/Pake/raw/master/download/Witeboard.dmg> <td><img src=https://gw.alipayobjects.com/zos/k/qc/SCR-20221018-fmj.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/o5QY4c.png width=600/></td>
![3](https://cdn.fliggy.com/upic/o5QY4c.png) </tr>
<tr>
### WhatsApp <td>WhatsApp <a href="https://github.com/tw93/Pake/raw/master/download/WhatsApp.dmg">Download</a></td>
<td>Vercel <a href="https://github.com/tw93/Pake/raw/master/download/Vercel.dmg">Download</a></td>
下载地址:<https://github.com/tw93/Pake/raw/master/download/WhatsApp.dmg> </tr>
<tr>
![4](https://cdn.fliggy.com/upic/upAJMb.png) <td><img src=https://cdn.fliggy.com/upic/upAJMb.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/CPVRnY.png width=600/></td>
### Vercel </tr>
</table>
下载地址:<https://github.com/tw93/Pake/raw/master/download/Vercel.dmg>
![5](https://cdn.fliggy.com/upic/CPVRnY.png)
## 开发 ## 开发
@@ -70,7 +69,7 @@ npm run build
## 打新包 ## 打新包
1. 修改 `src-tauri` 目录下的 `tauri.conf.json` 中的 `productName、icon、title、identifier` 这 4 个字段,其中 icon 可以去 [macosicons](https://macosicons.com/#/) 下载并放到 `icons` 目录下即可 1. 修改 `src-tauri` 目录下的 `tauri.conf.json` 中的 `productName、icon、title、identifier` 这 4 个字段,其中 icon 可以去 [macosicons](https://macosicons.com/#/) Download并放到 `icons` 目录下即可
2. 修改 `src-tauri/src` 目录下的 `main.rs` 中的 with_url 字段为你需要打包网页的地址 2. 修改 `src-tauri/src` 目录下的 `main.rs` 中的 with_url 字段为你需要打包网页的地址
3. `npm run dev` 本地调试看看效果,此外可以打开 `main.rs` 中 devtools 两处注释(搜索 `_devtools`)进行容器调试 3. `npm run dev` 本地调试看看效果,此外可以打开 `main.rs` 中 devtools 两处注释(搜索 `_devtools`)进行容器调试
4. `npm run build` 运行即可打包,假如有打开 devtools 模式,记得注释掉 4. `npm run build` 运行即可打包,假如有打开 devtools 模式,记得注释掉

View File

@@ -21,37 +21,37 @@
5. `command + r`Refresh Page 5. `command + r`Refresh Page
6. `command + w`Hide window, not quite 6. `command + w`Hide window, not quite
In addition, it supports double clicking the head to switch to full screen, and dragging the head to move the window
## Effect ## Effect
### WeRead
Download<https://github.com/tw93/Pake/raw/master/download/WeRead.dmg> <table>
<tr>
![1](https://cdn.fliggy.com/upic/ffUmdj.png) <td>WeRead <a href="https://github.com/tw93/Pake/raw/master/download/WeRead.dmg">Download</a></td>
<td>Flomo <a href="https://github.com/tw93/Pake/raw/master/download/Flomo.dmg">Download</a></td>
### Flomo </tr>
<tr>
Download<https://github.com/tw93/Pake/raw/master/download/Flomo.dmg> <td><img src=https://cdn.fliggy.com/upic/ffUmdj.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/B49SAc.png width=600/></td>
![2](https://cdn.fliggy.com/upic/B49SAc.png) </tr>
<tr>
### Witeboard <td>RunCode <a href="https://github.com/tw93/Pake/raw/master/download/RunCode.dmg">Download</a></td>
<td>Witeboard <a href="https://github.com/tw93/Pake/raw/master/download/Witeboard.dmg">Download</a></td>
Download<https://github.com/tw93/Pake/raw/master/download/Witeboard.dmg> </tr>
<tr>
![3](https://cdn.fliggy.com/upic/o5QY4c.png) <td><img src=https://gw.alipayobjects.com/zos/k/qc/SCR-20221018-fmj.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/o5QY4c.png width=600/></td>
### WhatsApp </tr>
<tr>
Download<https://github.com/tw93/Pake/raw/master/download/WhatsApp.dmg> <td>WhatsApp <a href="https://github.com/tw93/Pake/raw/master/download/WhatsApp.dmg">Download</a></td>
<td>Vercel <a href="https://github.com/tw93/Pake/raw/master/download/Vercel.dmg">Download</a></td>
![4](https://cdn.fliggy.com/upic/upAJMb.png) </tr>
<tr>
### Vercel <td><img src=https://cdn.fliggy.com/upic/upAJMb.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/CPVRnY.png width=600/></td>
Download<https://github.com/tw93/Pake/raw/master/download/Vercel.dmg> </tr>
</table>
![5](https://cdn.fliggy.com/upic/CPVRnY.png)
## Development ## Development

View File

@@ -10,6 +10,7 @@
"email": "tw93@qq.com" "email": "tw93@qq.com"
}, },
"scripts": { "scripts": {
"start": "npm run dev",
"dev": "TAURI_SKIP_DEVSERVER_CHECK=true npm run tauri dev", "dev": "TAURI_SKIP_DEVSERVER_CHECK=true npm run tauri dev",
"build": "TAURI_SKIP_DEVSERVER_CHECK=true npm run tauri build -- --target universal-apple-darwin", "build": "TAURI_SKIP_DEVSERVER_CHECK=true npm run tauri build -- --target universal-apple-darwin",
"tauri": "tauri" "tauri": "tauri"

BIN
src-tauri/icons/code.icns Normal file

Binary file not shown.

View File

@@ -1,5 +1,3 @@
use wry::application::window::Fullscreen;
fn main() -> wry::Result<()> { fn main() -> wry::Result<()> {
use wry::{ use wry::{
application::{ application::{
@@ -9,7 +7,7 @@ fn main() -> wry::Result<()> {
keyboard::KeyCode, keyboard::KeyCode,
menu::{MenuBar as Menu, MenuItem, MenuItemAttributes, MenuType}, menu::{MenuBar as Menu, MenuItem, MenuItemAttributes, MenuType},
platform::macos::WindowBuilderExtMacOS, platform::macos::WindowBuilderExtMacOS,
window::{Window, WindowBuilder}, window::{Window, WindowBuilder, Fullscreen},
}, },
webview::WebViewBuilder, webview::WebViewBuilder,
}; };
@@ -45,6 +43,10 @@ fn main() -> wry::Result<()> {
top: 154px !important; top: 154px !important;
} }
.columns .column #header{
padding-top: 30px;
}
.drawing-board .toolbar .toolbar-action, .drawing-board .toolbar .toolbar-action,
.c-swiper-container, .c-swiper-container,
.download_entry, .download_entry,
@@ -138,11 +140,13 @@ fn main() -> wry::Result<()> {
let handler = move |window: &Window, req: String| { let handler = move |window: &Window, req: String| {
if req == "drag_window" { if req == "drag_window" {
println!("drag_window on"); let _ = window.drag_window();
let _ = window.drag_window();
} else if req == "fullscreen" { } else if req == "fullscreen" {
println!("fullscreen on"); if window.fullscreen().is_some() {
let _ = window.set_fullscreen(Some(Fullscreen::Borderless(None))); window.set_fullscreen(None);
}else{
window.set_fullscreen(Some(Fullscreen::Borderless(None)));
}
} }
}; };