padded icons for linux mint
This commit is contained in:
+10
-3
@@ -153,8 +153,11 @@ async function resolveTrayIconForTheme() {
|
|||||||
const existingTheme = usePersistedStore.getState().appearance
|
const existingTheme = usePersistedStore.getState().appearance
|
||||||
console.log('[resolveTrayIconForTheme] existingTheme', existingTheme)
|
console.log('[resolveTrayIconForTheme] existingTheme', existingTheme)
|
||||||
|
|
||||||
|
const isLinuxMint = platform() === 'linux' && (await invoke<boolean>('is_linux_mint'))
|
||||||
|
const suffix = isLinuxMint ? '-padded' : ''
|
||||||
|
|
||||||
if (existingTheme.tray === 'color') {
|
if (existingTheme.tray === 'color') {
|
||||||
return await resolveResource('icons/favicon/icon-color.png')
|
return await resolveResource(`icons/favicon/icon-color${suffix}.png`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existingTheme.tray === 'system') {
|
if (existingTheme.tray === 'system') {
|
||||||
@@ -168,7 +171,9 @@ async function resolveTrayIconForTheme() {
|
|||||||
console.log('[resolveTrayIconForTheme] windowTheme', windowTheme)
|
console.log('[resolveTrayIconForTheme] windowTheme', windowTheme)
|
||||||
|
|
||||||
const pickedPath =
|
const pickedPath =
|
||||||
windowTheme === 'dark' ? 'icons/favicon/icon.png' : 'icons/favicon/icon-light.png'
|
windowTheme === 'dark'
|
||||||
|
? `icons/favicon/icon${suffix}.png`
|
||||||
|
: `icons/favicon/icon-light${suffix}.png`
|
||||||
|
|
||||||
return await resolveResource(pickedPath)
|
return await resolveResource(pickedPath)
|
||||||
} catch {
|
} catch {
|
||||||
@@ -182,7 +187,9 @@ async function resolveTrayIconForTheme() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pickedPath =
|
const pickedPath =
|
||||||
existingTheme.tray === 'dark' ? 'icons/favicon/icon-light.png' : 'icons/favicon/icon.png'
|
existingTheme.tray === 'dark'
|
||||||
|
? `icons/favicon/icon-light${suffix}.png`
|
||||||
|
: `icons/favicon/icon${suffix}.png`
|
||||||
|
|
||||||
return await resolveResource(pickedPath)
|
return await resolveResource(pickedPath)
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -35,6 +35,34 @@ fn is_flatpak() -> bool {
|
|||||||
std::path::Path::new("/.flatpak-info").exists() || std::env::var_os("FLATPAK_ID").is_some()
|
std::path::Path::new("/.flatpak-info").exists() || std::env::var_os("FLATPAK_ID").is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn is_linux_mint() -> bool {
|
||||||
|
#[cfg(not(target_os = "linux"))]
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
{
|
||||||
|
let paths: &[&str] = if is_flatpak() {
|
||||||
|
&["/run/host/os-release", "/etc/os-release", "/usr/lib/os-release"]
|
||||||
|
} else {
|
||||||
|
&["/etc/os-release", "/usr/lib/os-release"]
|
||||||
|
};
|
||||||
|
|
||||||
|
for path in paths {
|
||||||
|
if let Ok(contents) = std::fs::read_to_string(path) {
|
||||||
|
return contents.lines().any(|line| {
|
||||||
|
let line = line.trim();
|
||||||
|
line == "ID=linuxmint" || line == "ID=\"linuxmint\""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn unzip_file(zip_path: &str, output_folder: &str) -> Result<(), String> {
|
fn unzip_file(zip_path: &str, output_folder: &str) -> Result<(), String> {
|
||||||
// Open the zip file
|
// Open the zip file
|
||||||
@@ -828,6 +856,7 @@ pub fn run() {
|
|||||||
update_system_rclone,
|
update_system_rclone,
|
||||||
test_proxy_connection,
|
test_proxy_connection,
|
||||||
is_flatpak,
|
is_flatpak,
|
||||||
|
is_linux_mint,
|
||||||
open_full_window,
|
open_full_window,
|
||||||
open_window,
|
open_window,
|
||||||
open_small_window,
|
open_small_window,
|
||||||
|
|||||||
Reference in New Issue
Block a user