Add a open in folder button
This commit is contained in:
6 files changed
+19
-4
No files matched your search
@@ -13,7 +13,7 @@
|
|||||||
"@tailwindcss/vite": "4.2.2",
|
"@tailwindcss/vite": "4.2.2",
|
||||||
"@tauri-apps/api": "2.10.1",
|
"@tauri-apps/api": "2.10.1",
|
||||||
"@tauri-apps/plugin-dialog": "~2",
|
"@tauri-apps/plugin-dialog": "~2",
|
||||||
"@tauri-apps/plugin-opener": "2.5.3",
|
"@tauri-apps/plugin-opener": "~2",
|
||||||
"@tauri-apps/plugin-shell": "~2",
|
"@tauri-apps/plugin-shell": "~2",
|
||||||
"pretty-bytes": "^7.1.0",
|
"pretty-bytes": "^7.1.0",
|
||||||
"react": "19.2.5",
|
"react": "19.2.5",
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
"@tailwindcss/vite": "4.2.2",
|
"@tailwindcss/vite": "4.2.2",
|
||||||
"@tauri-apps/api": "2.10.1",
|
"@tauri-apps/api": "2.10.1",
|
||||||
"@tauri-apps/plugin-dialog": "~2",
|
"@tauri-apps/plugin-dialog": "~2",
|
||||||
"@tauri-apps/plugin-opener": "2.5.3",
|
"@tauri-apps/plugin-opener": "~2",
|
||||||
"@tauri-apps/plugin-shell": "~2",
|
"@tauri-apps/plugin-shell": "~2",
|
||||||
"pretty-bytes": "^7.1.0",
|
"pretty-bytes": "^7.1.0",
|
||||||
"react": "19.2.5",
|
"react": "19.2.5",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ sysinfo = "0.38.4"
|
|||||||
walkdir = "2.5.0"
|
walkdir = "2.5.0"
|
||||||
tauri-plugin-shell = "2"
|
tauri-plugin-shell = "2"
|
||||||
tauri-plugin-dialog = "2"
|
tauri-plugin-dialog = "2"
|
||||||
|
tauri-plugin-opener = "2"
|
||||||
|
|
||||||
[target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies]
|
[target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies]
|
||||||
window-vibrancy = "0.7.1"
|
window-vibrancy = "0.7.1"
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"permissions": [
|
"permissions": [
|
||||||
"core:default",
|
"core:default",
|
||||||
"shell:default",
|
"shell:default",
|
||||||
"dialog:default"
|
"dialog:default",
|
||||||
|
"opener:default"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -151,6 +151,7 @@ fn remove_item(path: String) -> Result<(), String> {
|
|||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
|
.plugin(tauri_plugin_opener::init())
|
||||||
.plugin(tauri_plugin_dialog::init())
|
.plugin(tauri_plugin_dialog::init())
|
||||||
.plugin(tauri_plugin_shell::init())
|
.plugin(tauri_plugin_shell::init())
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![
|
||||||
|
|||||||
+13
-1
@@ -6,12 +6,14 @@ import { faHardDrive } from '@fortawesome/free-solid-svg-icons'
|
|||||||
import {
|
import {
|
||||||
faFile,
|
faFile,
|
||||||
faFolder,
|
faFolder,
|
||||||
|
faFolderOpen,
|
||||||
faTrashCan
|
faTrashCan
|
||||||
} from '@fortawesome/free-regular-svg-icons'
|
} from '@fortawesome/free-regular-svg-icons'
|
||||||
import { v5 as uuidv5 } from 'uuid'
|
import { v5 as uuidv5 } from 'uuid'
|
||||||
import prettyBytes from 'pretty-bytes'
|
import prettyBytes from 'pretty-bytes'
|
||||||
import { ask, message, open } from '@tauri-apps/plugin-dialog'
|
import { ask, message, open } from '@tauri-apps/plugin-dialog'
|
||||||
import { listen } from '@tauri-apps/api/event'
|
import { listen } from '@tauri-apps/api/event'
|
||||||
|
import { revealItemInDir } from '@tauri-apps/plugin-opener'
|
||||||
|
|
||||||
interface Disk {
|
interface Disk {
|
||||||
name: string
|
name: string
|
||||||
@@ -180,7 +182,17 @@ export default function App () {
|
|||||||
{f.name}
|
{f.name}
|
||||||
</p>
|
</p>
|
||||||
<div className='flex flex-row gap-2 items-center'>
|
<div className='flex flex-row gap-2 items-center'>
|
||||||
<div className='w-8 h-6 flex justify-center items-center'>
|
<div className='w-4 h-6 flex justify-center items-center'>
|
||||||
|
<FontAwesomeIcon
|
||||||
|
icon={faFolderOpen}
|
||||||
|
className='text-white/60 hover:text-white/75 transition-all hover:scale-110'
|
||||||
|
onClick={async e => {
|
||||||
|
e.stopPropagation()
|
||||||
|
revealItemInDir(f.path)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className='w-4 h-6 flex justify-center items-center'>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faTrashCan}
|
icon={faTrashCan}
|
||||||
className='text-red-500/60 hover:text-red-500/75 transition-all hover:scale-110'
|
className='text-red-500/60 hover:text-red-500/75 transition-all hover:scale-110'
|
||||||
|
|||||||
Reference in new issue
Block a user