mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
feat(tray): black icon for macOS
This commit is contained in:
parent
c80bf48d13
commit
6db51d648b
@ -23,6 +23,7 @@ function generateDpiScaledIcons {
|
|||||||
inkscape -w 32 -h 32 "$file" -o "$output_dir/$name@2x.png"
|
inkscape -w 32 -h 32 "$file" -o "$output_dir/$name@2x.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generateDpiScaledIcons "$images_dir/icon-black.svg"
|
||||||
generateDpiScaledIcons "$images_dir/icon-color.svg"
|
generateDpiScaledIcons "$images_dir/icon-color.svg"
|
||||||
generateDpiScaledIcons "$images_dir/icon-purple.svg"
|
generateDpiScaledIcons "$images_dir/icon-purple.svg"
|
||||||
|
|
||||||
|
BIN
images/app-icons/tray/icon-black.png
Normal file
BIN
images/app-icons/tray/icon-black.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 390 B |
BIN
images/app-icons/tray/icon-black@1.25x.png
Normal file
BIN
images/app-icons/tray/icon-black@1.25x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 490 B |
BIN
images/app-icons/tray/icon-black@1.5x.png
Normal file
BIN
images/app-icons/tray/icon-black@1.5x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 589 B |
BIN
images/app-icons/tray/icon-black@2x.png
Normal file
BIN
images/app-icons/tray/icon-black@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 728 B |
@ -11,7 +11,7 @@ import becca_service from "../becca/becca_service.js";
|
|||||||
import type BRecentNote from "../becca/entities/brecent_note.js";
|
import type BRecentNote from "../becca/entities/brecent_note.js";
|
||||||
import { ipcMain, nativeTheme } from "electron/main";
|
import { ipcMain, nativeTheme } from "electron/main";
|
||||||
import { default as i18next, t } from "i18next";
|
import { default as i18next, t } from "i18next";
|
||||||
import { isDev } from "./utils.js";
|
import { isDev, isMac } from "./utils.js";
|
||||||
import cls from "./cls.js";
|
import cls from "./cls.js";
|
||||||
|
|
||||||
let tray: Tray;
|
let tray: Tray;
|
||||||
@ -19,21 +19,15 @@ let tray: Tray;
|
|||||||
// is minimized
|
// is minimized
|
||||||
let isVisible = true;
|
let isVisible = true;
|
||||||
|
|
||||||
// Inspired by https://github.com/signalapp/Signal-Desktop/blob/dcb5bb672635c4b29a51adec8a5658e3834ec8fc/app/tray_icon.ts#L20
|
|
||||||
function getIconSize() {
|
|
||||||
switch (process.platform) {
|
|
||||||
case "darwin":
|
|
||||||
return 16;
|
|
||||||
case "win32":
|
|
||||||
return 32;
|
|
||||||
default:
|
|
||||||
return 256;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTrayIconPath() {
|
function getTrayIconPath() {
|
||||||
const iconSize = getIconSize();
|
let name: string;
|
||||||
const name = isDev ? "icon-purple" : "icon-color";
|
if (isMac) {
|
||||||
|
name = "icon-black";
|
||||||
|
} else if (isDev) {
|
||||||
|
name = "icon-purple";
|
||||||
|
} else {
|
||||||
|
name = "icon-color";
|
||||||
|
}
|
||||||
|
|
||||||
return path.join(path.dirname(fileURLToPath(import.meta.url)), "../..", "images", "app-icons", "tray", `${name}.png`);
|
return path.join(path.dirname(fileURLToPath(import.meta.url)), "../..", "images", "app-icons", "tray", `${name}.png`);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user