padded icons for linux mint
This commit is contained in:
+10
-3
@@ -153,8 +153,11 @@ async function resolveTrayIconForTheme() {
|
||||
const existingTheme = usePersistedStore.getState().appearance
|
||||
console.log('[resolveTrayIconForTheme] existingTheme', existingTheme)
|
||||
|
||||
const isLinuxMint = platform() === 'linux' && (await invoke<boolean>('is_linux_mint'))
|
||||
const suffix = isLinuxMint ? '-padded' : ''
|
||||
|
||||
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') {
|
||||
@@ -168,7 +171,9 @@ async function resolveTrayIconForTheme() {
|
||||
console.log('[resolveTrayIconForTheme] windowTheme', windowTheme)
|
||||
|
||||
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)
|
||||
} catch {
|
||||
@@ -182,7 +187,9 @@ async function resolveTrayIconForTheme() {
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
#[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]
|
||||
fn unzip_file(zip_path: &str, output_folder: &str) -> Result<(), String> {
|
||||
// Open the zip file
|
||||
@@ -828,6 +856,7 @@ pub fn run() {
|
||||
update_system_rclone,
|
||||
test_proxy_connection,
|
||||
is_flatpak,
|
||||
is_linux_mint,
|
||||
open_full_window,
|
||||
open_window,
|
||||
open_small_window,
|
||||
|
||||
Reference in New Issue
Block a user