Compare commits
4
Commits
c339436d4c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be3d44420a
|
||
|
|
3fa83d9422
|
||
|
|
04dca68d13
|
||
|
|
a21245a210
|
No files matched your search
@@ -29,6 +29,7 @@ window-vibrancy = "0.7.1"
|
|||||||
windows-version = "0.1.7"
|
windows-version = "0.1.7"
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||||
|
tauri-plugin-single-instance = "2"
|
||||||
tauri-plugin-window-state = "2"
|
tauri-plugin-window-state = "2"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::{collections::HashMap, fs, path::PathBuf, sync::Mutex};
|
|||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sysinfo::Disks;
|
use sysinfo::Disks;
|
||||||
use tauri::{State, WebviewUrl, WebviewWindowBuilder};
|
use tauri::{Manager, State, WebviewUrl, WebviewWindowBuilder};
|
||||||
|
|
||||||
use tauri_plugin_shell::ShellExt;
|
use tauri_plugin_shell::ShellExt;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
@@ -102,7 +102,7 @@ fn stream(node: &serde_json::Value, parent: &str, map: &mut HashMap<String, Vec<
|
|||||||
format!("{}/{}", parent, name)
|
format!("{}/{}", parent, name)
|
||||||
};
|
};
|
||||||
|
|
||||||
let is_dir = PathBuf::from(&path).is_dir();
|
let is_dir = children.map_or(false, |c| !c.is_empty());
|
||||||
|
|
||||||
map.entry(parent.to_string()).or_default().push(FileInfo {
|
map.entry(parent.to_string()).or_default().push(FileInfo {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
@@ -163,6 +163,11 @@ fn reset_scan(state: State<'_, AppState>) {
|
|||||||
#[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_single_instance::init(|app, _args, _cwd| {
|
||||||
|
if let Some(window) = app.get_webview_window("main") {
|
||||||
|
let _ = window.set_focus();
|
||||||
|
}
|
||||||
|
}))
|
||||||
.plugin(tauri_plugin_window_state::Builder::new().build())
|
.plugin(tauri_plugin_window_state::Builder::new().build())
|
||||||
.plugin(tauri_plugin_prevent_default::init())
|
.plugin(tauri_plugin_prevent_default::init())
|
||||||
.plugin(tauri_plugin_opener::init())
|
.plugin(tauri_plugin_opener::init())
|
||||||
|
|||||||
+5
-5
@@ -165,7 +165,7 @@ export default function App () {
|
|||||||
{breadcrumbs.map((p, i) => (
|
{breadcrumbs.map((p, i) => (
|
||||||
<button
|
<button
|
||||||
key={p + i}
|
key={p + i}
|
||||||
className='cursor-pointer bg-(--col2)/50 hover:bg-(--col4)/50 border border-(--col4)/50 hover:border-(--col6)/50 px-2 py-1 rounded-lg transition-colors text-white/60 hover:text-white/75'
|
className='cursor-pointer bg-(--col2)/50 hover:bg-(--col4)/50 border border-(--col4)/50 hover:border-(--col6)/50 px-2 py-1 rounded-lg transition-colors text-white'
|
||||||
onClick={() => setCurrentPath(p)}
|
onClick={() => setCurrentPath(p)}
|
||||||
>
|
>
|
||||||
{i == 0 ? p : p.split('/').pop()}
|
{i == 0 ? p : p.split('/').pop()}
|
||||||
@@ -173,7 +173,7 @@ export default function App () {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
className='cursor-pointer bg-(--col2)/50 hover:bg-(--col4)/50 border border-(--col4)/50 hover:border-(--col6)/50 px-2 py-1 rounded-lg transition-colors text-white/60 hover:text-white/75 absolute right-0'
|
className='cursor-pointer bg-(--col2)/50 hover:bg-(--col4)/50 border border-(--col4)/50 hover:border-(--col6)/50 px-2 py-1 rounded-lg transition-colors text-white absolute right-0'
|
||||||
onClick={() => goBackToDisks()}
|
onClick={() => goBackToDisks()}
|
||||||
>
|
>
|
||||||
Back
|
Back
|
||||||
@@ -193,7 +193,7 @@ export default function App () {
|
|||||||
<p>
|
<p>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={f.is_dir ? faFolder : faFile}
|
icon={f.is_dir ? faFolder : faFile}
|
||||||
className='text-white/60 hover:text-white/75 transition-all hover:scale-110'
|
className='text-white transition-all hover:scale-110'
|
||||||
/>{' '}
|
/>{' '}
|
||||||
{f.name}
|
{f.name}
|
||||||
</p>
|
</p>
|
||||||
@@ -204,7 +204,7 @@ export default function App () {
|
|||||||
>
|
>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faFolderOpen}
|
icon={faFolderOpen}
|
||||||
className='text-white/60 hover:text-white/75 transition-all hover:scale-110'
|
className='text-white transition-all hover:scale-110'
|
||||||
onClick={async e => {
|
onClick={async e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
revealItemInDir(f.path)
|
revealItemInDir(f.path)
|
||||||
@@ -217,7 +217,7 @@ export default function App () {
|
|||||||
>
|
>
|
||||||
<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 transition-all hover:scale-110'
|
||||||
onClick={async e => {
|
onClick={async e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user