Skip to content

Commit

Permalink
✨ 支持双击全屏切换和新应用runcode
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed Oct 18, 2022
1 parent 1ff62dc commit bff9b32
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 65 deletions.
59 changes: 29 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,36 @@
5. `command + r`:刷新页面
6. `command + w`:隐藏窗口,非退出

## 效果

### 微信读书

下载地址:<https://github.com/tw93/Pake/raw/master/download/WeRead.dmg>

![1](https://cdn.fliggy.com/upic/ffUmdj.png)

### Flomo

下载地址:<https://github.com/tw93/Pake/raw/master/download/Flomo.dmg>

![2](https://cdn.fliggy.com/upic/B49SAc.png)

### Witeboard
此外还支持双击头部进行全屏切换,拖拽头部进行移动窗口,还有其他需求,欢迎提过来。

下载地址:<https://github.com/tw93/Pake/raw/master/download/Witeboard.dmg>

![3](https://cdn.fliggy.com/upic/o5QY4c.png)

### WhatsApp

下载地址:<https://github.com/tw93/Pake/raw/master/download/WhatsApp.dmg>

![4](https://cdn.fliggy.com/upic/upAJMb.png)

### Vercel

下载地址:<https://github.com/tw93/Pake/raw/master/download/Vercel.dmg>
## 效果

![5](https://cdn.fliggy.com/upic/CPVRnY.png)
<table>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
</table>

## 开发

Expand All @@ -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 字段为你需要打包网页的地址
3. `npm run dev` 本地调试看看效果,此外可以打开 `main.rs` 中 devtools 两处注释(搜索 `_devtools`)进行容器调试
4. `npm run build` 运行即可打包,假如有打开 devtools 模式,记得注释掉
Expand Down
56 changes: 28 additions & 28 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,37 @@
5. `command + r`:Refresh Page
6. `command + w`:Hide window, not quite

## Effect

### WeRead

Download:<https://github.com/tw93/Pake/raw/master/download/WeRead.dmg>

![1](https://cdn.fliggy.com/upic/ffUmdj.png)

### Flomo

Download:<https://github.com/tw93/Pake/raw/master/download/Flomo.dmg>

![2](https://cdn.fliggy.com/upic/B49SAc.png)
In addition, it supports double clicking the head to switch to full screen, and dragging the head to move the window

### Witeboard

Download:<https://github.com/tw93/Pake/raw/master/download/Witeboard.dmg>

![3](https://cdn.fliggy.com/upic/o5QY4c.png)

### WhatsApp

Download:<https://github.com/tw93/Pake/raw/master/download/WhatsApp.dmg>

![4](https://cdn.fliggy.com/upic/upAJMb.png)

### Vercel
## Effect

Download:<https://github.com/tw93/Pake/raw/master/download/Vercel.dmg>

![5](https://cdn.fliggy.com/upic/CPVRnY.png)
<table>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
</table>

## Development

Expand Down
Binary file added download/RunCode.dmg
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"email": "tw93@qq.com"
},
"scripts": {
"start": "npm run 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",
"tauri": "tauri"
Expand Down
Binary file added src-tauri/icons/code.icns
Binary file not shown.
18 changes: 11 additions & 7 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use wry::application::window::Fullscreen;

fn main() -> wry::Result<()> {
use wry::{
application::{
Expand All @@ -9,7 +7,7 @@ fn main() -> wry::Result<()> {
keyboard::KeyCode,
menu::{MenuBar as Menu, MenuItem, MenuItemAttributes, MenuType},
platform::macos::WindowBuilderExtMacOS,
window::{Window, WindowBuilder},
window::{Window, WindowBuilder, Fullscreen},
},
webview::WebViewBuilder,
};
Expand Down Expand Up @@ -45,6 +43,10 @@ fn main() -> wry::Result<()> {
top: 154px !important;
}
.columns .column #header{
padding-top: 30px;
}
.drawing-board .toolbar .toolbar-action,
.c-swiper-container,
.download_entry,
Expand Down Expand Up @@ -138,11 +140,13 @@ fn main() -> wry::Result<()> {

let handler = move |window: &Window, req: String| {
if req == "drag_window" {
println!("drag_window on");
let _ = window.drag_window();
let _ = window.drag_window();
} else if req == "fullscreen" {
println!("fullscreen on");
let _ = window.set_fullscreen(Some(Fullscreen::Borderless(None)));
if window.fullscreen().is_some() {
window.set_fullscreen(None);
}else{
window.set_fullscreen(Some(Fullscreen::Borderless(None)));
}
}
};

Expand Down

0 comments on commit bff9b32

Please sign in to comment.