Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wyhaya committed Sep 14, 2024
1 parent 4dfe2c4 commit 0858170
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 316 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,23 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
tauri-v1/target/
tauri-v2/target/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup Rust
run: |
rustup update
rustup target add ${{ matrix.job.target }}
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev -y
sudo apt install libwebkit2gtk-4.1-dev libxdo-dev -y
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev -y
- name: Cargo fmt
run: |
cd tauri-v1 && cargo fmt --all -- --check && cd ..
cd tauri-v2 && cargo fmt --all -- --check && cd ..
cargo fmt --all -- --check
- name: Cargo build v1
- name: Cargo build
run: |
cd tauri-v1 && cargo build --target ${{ matrix.job.target }} && cd ..
- name: Cargo build v2
run: |
cd tauri-v2 && cargo build --target ${{ matrix.job.target }} && cd ..
cargo build --target ${{ matrix.job.target }}
File renamed without changes.
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Tauri currently doesn't support dynamically change app theme, this plugin makes

https://github.com/wyhaya/tauri-plugin-theme/assets/23690145/2422ce95-418d-4f07-adf5-e78af2552f51

> [!NOTE]
> This only applies to the `Tauri 2x` version. If you are using the Tauri 1x version, please refer to [tauri-1x-version](https://github.com/wyhaya/tauri-plugin-theme/tree/tauri-1x-version).
## Install

```bash
# For tauri@v1
cargo add tauri-plugin-theme@1
# For tauri@v2
cargo add tauri-plugin-theme@2
cargo add tauri-plugin-theme@2.1.0
```

```rust
Expand All @@ -23,6 +23,20 @@ tauri::Builder::default()
// ...
```

### Tauri permissions

Add to `src-tauri/capabilities/default.json`

```json5
{
...
"permissions": [
...
"theme:default"
]
}
```

## Usage

```javascript
Expand All @@ -47,27 +61,11 @@ const theme = await invoke("plugin:theme|get_theme");

When you call `set_theme`, the theme will be auto saved, and it will be restored auto after the App restart.

### Tauri permissions

If you're using `tauri@v2` you'll also need to add the plugin's permissions file

Add to `src-tauri/capabilities/default.json`

```json5
{
...
"permissions": [
...
"theme:default"
]
}
```

## Support

| MacOS | Linux | Windows | Android | iOS |
| ----- | ----- | ------- | ------- | ------- |
| ✅ | ✅ | ✅ | ❌ | ❌
| ----- | ----- | ------- | ------- | --- |
||||| |

## NOTE

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 0 additions & 24 deletions tauri-v1/Cargo.toml

This file was deleted.

5 changes: 0 additions & 5 deletions tauri-v1/README.md

This file was deleted.

107 changes: 0 additions & 107 deletions tauri-v1/src/lib.rs

This file was deleted.

93 changes: 0 additions & 93 deletions tauri-v1/src/platform/linux.rs

This file was deleted.

23 changes: 0 additions & 23 deletions tauri-v1/src/platform/macos.rs

This file was deleted.

9 changes: 0 additions & 9 deletions tauri-v1/src/platform/windows.rs

This file was deleted.

5 changes: 0 additions & 5 deletions tauri-v2/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions tauri-v2/src/platform/mod.rs

This file was deleted.

0 comments on commit 0858170

Please sign in to comment.