Skip to content

Commit

Permalink
style: format code style
Browse files Browse the repository at this point in the history
  • Loading branch information
JunaYa committed Dec 20, 2024
1 parent 2e285e7 commit 14ee734
Show file tree
Hide file tree
Showing 15 changed files with 215 additions and 150 deletions.
9 changes: 9 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import antfu from '@antfu/eslint-config'

export default antfu({
ignores: [
'public/**',
'src-tauri/**',
'**/target/**',
],
})
20 changes: 0 additions & 20 deletions eslint.config.mjs

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview",
"lint": "echo 'eslint'",
"lint:fix": "eslint . --fix",
"tauri": "tauri"
},
"dependencies": {
Expand All @@ -26,14 +27,13 @@
"vue": "^3.5.13"
},
"devDependencies": {
"@antfu/eslint-config": "^3.11.2",
"@antfu/eslint-config": "^3.12.0",
"@tauri-apps/cli": "^2.1.0",
"@types/node": "^22.10.2",
"@unocss/eslint-config": "^0.64.1",
"@unocss/preset-mini": "^0.64.1",
"@vitejs/plugin-vue": "^5.2.1",
"eslint": "^9.16.0",
"eslint-plugin-format": "^0.1.3",
"unocss": "^0.64.1",
"vite": "^6.0.3",
"vue-tsc": "^2.1.10"
Expand Down
282 changes: 175 additions & 107 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ddu"
version = "0.1.8"
description = "Ddu screenshot tool"
authors = ["[email protected]"]
authors = [ "[email protected]" ]
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -12,10 +12,14 @@ edition = "2021"
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "ddu_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
crate-type = [
"staticlib",
"cdylib",
"rlib"
]

[build-dependencies]
tauri-build = { version = "2", features = ["config-json5"] }
tauri-build = { version = "2", features = [ "config-json5" ] }

[dependencies]
tauri = { version = "2", features = [
Expand All @@ -25,7 +29,7 @@ tauri = { version = "2", features = [
"tray-icon",
] }
tauri-plugin-shell = "2.0.0"
serde = { version = "1", features = ["derive"] }
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
chrono = "0.4.38"
anyhow = "1.0.93"
Expand All @@ -38,21 +42,21 @@ strum = "0.26.3"
image = "0.25.5"
tauri-plugin-store = "2"
xcap = "0.0.14"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tracing-subscriber = { version = "0.3.18", features = [ "env-filter" ] }
tracing = "0.1.40"
tauri-plugin-os = "2"
core-foundation = "0.10.0"
libc = "0.2.164"
base64 = "0.22.1"

[features]
default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"]
default = [ "custom-protocol" ]
custom-protocol = [ "tauri/custom-protocol" ]

[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-autostart = "2"
tauri-plugin-global-shortcut = "2"
tauri-plugin-positioner = { version = "2.0.0", features = ["tray-icon"] }
tauri-plugin-positioner = { version = "2.0.0", features = [ "tray-icon" ] }
tauri-plugin-window-state = "2"

[target."cfg(target_os = \"macos\")".dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/capabilities/clipboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"clipboard-manager:allow-write-image",
"clipboard-manager:allow-write-text"
]
}
}
2 changes: 1 addition & 1 deletion src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"positioner:allow-move-window",
"positioner:allow-set-tray-icon-state"
]
}
}
2 changes: 1 addition & 1 deletion src-tauri/capabilities/desktop.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"autostart:allow-disable",
"autostart:allow-is-enabled"
]
}
}
2 changes: 1 addition & 1 deletion src-tauri/capabilities/dialog.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"dialog:allow-open",
"dialog:allow-save"
]
}
}
4 changes: 2 additions & 2 deletions src-tauri/capabilities/filesystem.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"fs:allow-write",
{
"identifier": "fs:allow-exists",
"allow": [{ "path": "$APPDATA/*" }, { "path": "$HOME/*" } ]
"allow": [{ "path": "$APPDATA/*" }, { "path": "$HOME/*" }]
},
{
"identifier": "fs:allow-mkdir",
Expand Down Expand Up @@ -63,4 +63,4 @@
"allow": [{ "path": "$HOME/test.txt" }]
}
]
}
}
2 changes: 1 addition & 1 deletion src-tauri/capabilities/global-shortcut.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"global-shortcut:allow-unregister",
"global-shortcut:allow-unregister-all"
]
}
}
2 changes: 1 addition & 1 deletion src-tauri/capabilities/os.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"os:default",
"os:allow-version"
]
}
}
2 changes: 1 addition & 1 deletion src-tauri/capabilities/window.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"core:window:allow-internal-toggle-maximize",
"core:window:allow-set-cursor-icon"
]
}
}
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"withGlobalTauri": true,
"macOSPrivateApi": true,
"windows": [

],
"security": {
"csp": {
Expand Down
10 changes: 7 additions & 3 deletions src/pages/setting/componnets/WindowState.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { restoreStateCurrent, saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state'
import Button from '~/components/Button.vue'
async function onSaveWindowState() {
await saveWindowState(StateFlags.SIZE)
}
Expand All @@ -12,8 +13,11 @@ async function onRestoreWindowState() {

<template>
<div class="flex-row-start gap-2">
<Button class-name="btn-solid" :anim="true" @click="onSaveWindowState">Save Window State</Button>
<Button class-name="btn-solid" :anim="true" @click="onRestoreWindowState">Restore Window State</Button>
<Button class-name="btn-solid" :anim="true" @click="onSaveWindowState">
Save Window State
</Button>
<Button class-name="btn-solid" :anim="true" @click="onRestoreWindowState">
Restore Window State
</Button>
</div>
</template>

0 comments on commit 14ee734

Please sign in to comment.