desktop: use ico icons on windows
@@ -21,6 +21,7 @@ import { nativeTheme } from "electron";
|
||||
import path from "path";
|
||||
import { isDevelopment } from "./utils";
|
||||
|
||||
type Icons = "note-add" | "notebook-add" | "reminder-add" | "quit";
|
||||
const APP_DIR = isDevelopment()
|
||||
? process.cwd()
|
||||
: path.dirname(process.execPath);
|
||||
@@ -30,13 +31,15 @@ export class AssetManager {
|
||||
format?: "ico" | "png" | "icns";
|
||||
}) {
|
||||
const { size = 32, format } = options;
|
||||
|
||||
if (format === "ico") return path.join("assets", "icons", "app.ico");
|
||||
if (format === "icns") return path.join("assets", "icons", "app.icns");
|
||||
|
||||
return path.join("assets", "icons", `${size}x${size}.png`);
|
||||
}
|
||||
|
||||
static icon(name: "note-add" | "notebook-add" | "reminder-add" | "quit") {
|
||||
static icon(name: Icons, format: "png" | "ico" = "png") {
|
||||
const prefix = nativeTheme.shouldUseDarkColors ? ".dark" : "";
|
||||
return path.join(APP_DIR, "assets", "icons", `${name}${prefix}.png`);
|
||||
return path.join(APP_DIR, "assets", "icons", `${name}${prefix}.${format}`);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
apps/web/desktop/assets/icons/note-add.dark.ico
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
apps/web/desktop/assets/icons/note-add.ico
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
apps/web/desktop/assets/icons/notebook-add.dark.ico
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
apps/web/desktop/assets/icons/notebook-add.ico
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
apps/web/desktop/assets/icons/quit.dark.ico
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
apps/web/desktop/assets/icons/quit.ico
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
apps/web/desktop/assets/icons/reminder-add.dark.ico
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
apps/web/desktop/assets/icons/reminder-add.ico
Normal file
|
After Width: | Height: | Size: 34 KiB |
@@ -34,7 +34,7 @@ function windows() {
|
||||
items: [
|
||||
{
|
||||
program: process.execPath,
|
||||
iconPath: AssetManager.icon("note-add"),
|
||||
iconPath: AssetManager.icon("note-add", "ico"),
|
||||
args: "new note",
|
||||
description: "Create a new note",
|
||||
title: "New note",
|
||||
@@ -42,7 +42,7 @@ function windows() {
|
||||
},
|
||||
{
|
||||
program: process.execPath,
|
||||
iconPath: AssetManager.icon("notebook-add"),
|
||||
iconPath: AssetManager.icon("notebook-add", "ico"),
|
||||
args: "new notebook",
|
||||
description: "Create a new notebook",
|
||||
title: "New notebook",
|
||||
@@ -50,7 +50,7 @@ function windows() {
|
||||
},
|
||||
{
|
||||
program: process.execPath,
|
||||
iconPath: AssetManager.icon("reminder-add"),
|
||||
iconPath: AssetManager.icon("reminder-add", "ico"),
|
||||
args: "new reminder",
|
||||
description: "Add a new reminder",
|
||||
title: "New reminder",
|
||||
|
||||