Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to [email protected] #997

Merged
merged 16 commits into from
Aug 13, 2023
Merged
5 changes: 5 additions & 0 deletions .changes/tao-0.22.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": "minor"
---

Update to version `0.22` which has removed the global-shortcut, menus and tray features, see [[email protected] release](https://github.com/tauri-apps/tao/releases/tag/tao-v0.22.0).
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ jobs:
${{ matrix.platform }}-stable-cargo-core-

- name: build wry
run: cargo build --features tray --target ${{ matrix.platform.target }}
run: cargo build --target ${{ matrix.platform.target }}

- name: build tests and examples
shell: bash
if: (
!contains(matrix.platform.target, 'android') &&
!contains(matrix.platform.target, 'ios'))
run: cargo test --no-run --verbose --features tray --target ${{ matrix.platform.target }}
run: cargo test --no-run --verbose --target ${{ matrix.platform.target }}

- name: run tests
if: (
!contains(matrix.platform.target, 'android') &&
!contains(matrix.platform.target, 'ios'))
run: cargo test --verbose --features tray --target ${{ matrix.platform.target }}
run: cargo test --verbose --target ${{ matrix.platform.target }}
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = [ "gui" ]

[package.metadata.docs.rs]
default-features = false
features = [ "dox", "file-drop", "protocol", "tray" ]
features = [ "dox", "file-drop", "protocol" ]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
Expand All @@ -27,7 +27,6 @@ objc-exception = [ "objc/exception" ]
file-drop = [ ]
protocol = [ ]
dox = [ "tao/dox", "webkit2gtk/dox", "soup3/dox" ]
tray = [ "tao/tray" ]
devtools = [ ]
transparent = [ ]
fullscreen = [ ]
Expand All @@ -41,7 +40,7 @@ serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0"
thiserror = "1.0"
url = "2.4"
tao = { version = "0.21", default-features = false, features = [ "serde" ] }
Copy link
Member Author

@amrbashir amrbashir Aug 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waiting for the next tao relase

tao = { git = "https://github.com/tauri-apps/tao", branch = "dev", default-features = false, features = [ "serde" ] }
http = "0.2.9"

[dev-dependencies]
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Tao uses [gtk-rs](https://gtk-rs.org/) and its related libraries for window crea

```bash
sudo pacman -S webkit2gtk-4.1
sudo pacman -S libappindicator-gtk3 # For tray feature
```

The `libayatana-indicator` package can be installed from the Arch User Repository (AUR).
Expand All @@ -90,17 +89,12 @@ The `libayatana-indicator` package can be installed from the Arch User Repositor

```bash
sudo apt install libwebkit2gtk-4.1-dev
# For tray feature, choose one of following package
sudo apt install libayatana-appindicator3-dev
sudo apt install libappindicator3-dev
```

#### Fedora

```bash
sudo dnf install gtk3-devel webkit2gtk4.1-devel
# For tray feature
sudo dnf install libappindicator-gtk3-devel
```

Fedora does not have the Ayatana package yet, so you need to use the GTK one, see the [feature flags documentation](https://docs.rs/wry/latest/wry/#feature-flags).
Expand All @@ -121,7 +115,7 @@ WebView2 provided by Microsoft Edge Chromium is used. So wry supports Windows 7,

### Android / iOS

Wry supports mobile with the help of [`tauri-mobile`](https://github.com/tauri-apps/tauri-mobile) CLI to create template project. If you are interested in playing or hacking it, please follow [MOBILE.md](MOBILE.md).
Wry supports mobile with the help of [`tauri-mobile`](https://github.com/tauri-apps/tauri-mobile) CLI to create template project. If you are interested in playing or hacking it, please follow [MOBILE.md](MOBILE.md).

If you wish to create Android project yourself, there are a few kotlin files that are needed to run wry on Android and you have to set the following environment variables:

Expand Down
14 changes: 0 additions & 14 deletions examples/README.md

This file was deleted.

10 changes: 5 additions & 5 deletions examples/custom_titlebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ fn main() -> wry::Result<()> {
use wry::{
application::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop},
event_loop::{ControlFlow, EventLoopBuilder},
window::{Window, WindowBuilder},
},
webview::WebViewBuilder,
};

enum UserEvents {
enum UserEvent {
CloseWindow,
}

let event_loop = EventLoop::<UserEvents>::with_user_event();
let event_loop = EventLoopBuilder::<UserEvent>::with_user_event().build();
let window = WindowBuilder::new()
.with_decorations(false)
.build(&event_loop)
Expand Down Expand Up @@ -124,7 +124,7 @@ fn main() -> wry::Result<()> {
window.set_maximized(!window.is_maximized());
}
if req == "close" {
let _ = proxy.send_event(UserEvents::CloseWindow);
let _ = proxy.send_event(UserEvent::CloseWindow);
}
if req == "drag_window" {
let _ = window.drag_window();
Expand All @@ -149,7 +149,7 @@ fn main() -> wry::Result<()> {
event: WindowEvent::CloseRequested,
..
}
| Event::UserEvent(UserEvents::CloseWindow) => {
| Event::UserEvent(UserEvent::CloseWindow) => {
let _ = webview.take();
*control_flow = ControlFlow::Exit
}
Expand Down
4 changes: 2 additions & 2 deletions examples/download_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fn main() -> wry::Result<()> {
use wry::{
application::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop},
event_loop::{ControlFlow, EventLoopBuilder},
window::WindowBuilder,
},
webview::WebViewBuilder,
Expand All @@ -29,7 +29,7 @@ fn main() -> wry::Result<()> {
Rejected(String),
}

let event_loop: EventLoop<UserEvent> = EventLoop::with_user_event();
let event_loop = EventLoopBuilder::<UserEvent>::with_user_event().build();
let proxy = event_loop.create_proxy();
let window = WindowBuilder::new()
.with_title("Hello World")
Expand Down
10 changes: 5 additions & 5 deletions examples/eval_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ fn main() -> wry::Result<()> {
use wry::{
application::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop},
event_loop::{ControlFlow, EventLoopBuilder},
window::{Window, WindowBuilder},
},
webview::WebViewBuilder,
};

enum UserEvents {
enum UserEvent {
ExecEval,
}

let event_loop = EventLoop::<UserEvents>::with_user_event();
let event_loop = EventLoopBuilder::<UserEvent>::with_user_event().build();
let proxy = event_loop.create_proxy();

let window = WindowBuilder::new()
Expand All @@ -25,7 +25,7 @@ fn main() -> wry::Result<()> {

let ipc_handler = move |_: &Window, req: String| {
if req == "exec-eval" {
let _ = proxy.send_event(UserEvents::ExecEval);
let _ = proxy.send_event(UserEvent::ExecEval);
}
};

Expand All @@ -42,7 +42,7 @@ fn main() -> wry::Result<()> {
*control_flow = ControlFlow::Wait;

match event {
Event::UserEvent(UserEvents::ExecEval) => {
Event::UserEvent(UserEvent::ExecEval) => {
// String
_webview
.evaluate_script_with_callback(
Expand Down
108 changes: 0 additions & 108 deletions examples/menu.rs

This file was deleted.

18 changes: 9 additions & 9 deletions examples/multi_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ fn main() -> wry::Result<()> {
use wry::{
application::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop, EventLoopProxy, EventLoopWindowTarget},
event_loop::{ControlFlow, EventLoopBuilder, EventLoopProxy, EventLoopWindowTarget},
window::{Window, WindowBuilder, WindowId},
},
webview::{WebView, WebViewBuilder},
};

enum UserEvents {
enum UserEvent {
CloseWindow(WindowId),
NewWindow,
}

fn create_new_window(
title: String,
event_loop: &EventLoopWindowTarget<UserEvents>,
proxy: EventLoopProxy<UserEvents>,
event_loop: &EventLoopWindowTarget<UserEvent>,
proxy: EventLoopProxy<UserEvent>,
) -> (WindowId, WebView) {
let window = WindowBuilder::new()
.with_title(title)
Expand All @@ -30,10 +30,10 @@ fn main() -> wry::Result<()> {
let window_id = window.id();
let handler = move |window: &Window, req: String| match req.as_str() {
"new-window" => {
let _ = proxy.send_event(UserEvents::NewWindow);
let _ = proxy.send_event(UserEvent::NewWindow);
}
"close" => {
let _ = proxy.send_event(UserEvents::CloseWindow(window.id()));
let _ = proxy.send_event(UserEvent::CloseWindow(window.id()));
}
_ if req.starts_with("change-title") => {
let title = req.replace("change-title:", "");
Expand All @@ -58,7 +58,7 @@ fn main() -> wry::Result<()> {
(window_id, webview)
}

let event_loop = EventLoop::<UserEvents>::with_user_event();
let event_loop = EventLoopBuilder::<UserEvent>::with_user_event().build();
let mut webviews = HashMap::new();
let proxy = event_loop.create_proxy();

Expand All @@ -82,15 +82,15 @@ fn main() -> wry::Result<()> {
*control_flow = ControlFlow::Exit
}
}
Event::UserEvent(UserEvents::NewWindow) => {
Event::UserEvent(UserEvent::NewWindow) => {
let new_window = create_new_window(
format!("Window {}", webviews.len() + 1),
event_loop,
proxy.clone(),
);
webviews.insert(new_window.0, new_window.1);
}
Event::UserEvent(UserEvents::CloseWindow(id)) => {
Event::UserEvent(UserEvent::CloseWindow(id)) => {
webviews.remove(&id);
if webviews.is_empty() {
*control_flow = ControlFlow::Exit
Expand Down
4 changes: 2 additions & 2 deletions examples/navigation_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() -> wry::Result<()> {
use wry::{
application::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop},
event_loop::{ControlFlow, EventLoopBuilder},
window::WindowBuilder,
},
webview::WebViewBuilder,
Expand All @@ -16,7 +16,7 @@ fn main() -> wry::Result<()> {
Navigation(String),
}

let event_loop: EventLoop<UserEvent> = EventLoop::with_user_event();
let event_loop = EventLoopBuilder::<UserEvent>::with_user_event().build();
let proxy = event_loop.create_proxy();
let window = WindowBuilder::new()
.with_title("Hello World")
Expand Down
Loading
Loading