diff --git a/manifest.json b/manifest.json index 25b9efb..b245b63 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "excalibrain", "name": "ExcaliBrain", - "version": "0.1.12", + "version": "0.1.13", "minAppVersion": "0.15.6", "description": "A clean, intuitive and editable graph view for Obsidian", "author": "Zsolt Viczian", diff --git a/package-lock.json b/package-lock.json index c3e2d21..26750f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "cross-env": "^7.0.3", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", - "obsidian": "^1.1.1", + "obsidian": "^1.2.5", "obsidian-excalidraw-plugin": "1.7.11", "prettier": "^2.8.0", "rollup": "^2.79.1", @@ -12624,9 +12624,9 @@ } }, "node_modules/obsidian": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.1.1.tgz", - "integrity": "sha512-GcxhsHNkPEkwHEjeyitfYNBcQuYGeAHFs1pEpZIv0CnzSfui8p8bPLm2YKLgcg20B764770B1sYGtxCvk9ptxg==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.2.5.tgz", + "integrity": "sha512-RKN4W3PaHsoWwlNRg1SV+iJssQ5vnQYzsCSfmFAUHvA8Q8nzk4pW3HGWXSvor3ZM532KECljG86lEx02OvBwpA==", "dev": true, "dependencies": { "@types/codemirror": "0.0.108", @@ -27244,9 +27244,9 @@ } }, "obsidian": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.1.1.tgz", - "integrity": "sha512-GcxhsHNkPEkwHEjeyitfYNBcQuYGeAHFs1pEpZIv0CnzSfui8p8bPLm2YKLgcg20B764770B1sYGtxCvk9ptxg==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.2.5.tgz", + "integrity": "sha512-RKN4W3PaHsoWwlNRg1SV+iJssQ5vnQYzsCSfmFAUHvA8Q8nzk4pW3HGWXSvor3ZM532KECljG86lEx02OvBwpA==", "dev": true, "requires": { "@types/codemirror": "0.0.108", diff --git a/package.json b/package.json index 0b7ae23..3e93782 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@rollup/plugin-typescript": "^8.3.0", "@types/node": "^18.11.9", "cross-env": "^7.0.3", - "obsidian": "^1.1.1", + "obsidian": "^1.2.5", "rollup": "^2.79.1", "rollup-plugin-visualizer": "^5.6.0", "rollup-plugin-terser": "^7.0.2", diff --git a/src/Scene.ts b/src/Scene.ts index 98e5b26..0246491 100644 --- a/src/Scene.ts +++ b/src/Scene.ts @@ -211,6 +211,13 @@ export class Scene { return; } await (leaf ?? app.workspace.getLeaf(true)).openFile(file as TFile); + if(settings.defaultAlwaysOnTop && leaf) { + //@ts-ignore + const ownerWindow = leaf.view?.ownerWindow; + if(ownerWindow && (ownerWindow !== window) && !ownerWindow.electronWindow.isMaximized()) { + ownerWindow.electronWindow.setAlwaysOnTop(true); + } + } } public async initializeScene() { diff --git a/src/Settings.ts b/src/Settings.ts index c78fced..f2300f8 100644 --- a/src/Settings.ts +++ b/src/Settings.ts @@ -67,6 +67,7 @@ export interface ExcaliBrainSettings { boldFields: boolean; allowAutozoom: boolean; allowAutofocuOnSearch: boolean; + defaultAlwaysOnTop: boolean; } export const DEFAULT_SETTINGS: ExcaliBrainSettings = { @@ -154,6 +155,7 @@ export const DEFAULT_SETTINGS: ExcaliBrainSettings = { boldFields: false, allowAutozoom: true, allowAutofocuOnSearch: true, + defaultAlwaysOnTop: false, }; const HIDE_DISABLED_STYLE = "excalibrain-hide-disabled"; @@ -1715,6 +1717,17 @@ export class ExcaliBrainSettingTab extends PluginSettingTab { this.dirty = true; })) + new Setting(containerEl) + .setName(t("ALWAYS_ON_TOP_NAME")) + .setDesc(fragWithHTML(t("ALWAYS_ON_TOP_DESC"))) + .addToggle(toggle => + toggle + .setValue(this.plugin.settings.defaultAlwaysOnTop) + .onChange(value => { + this.plugin.settings.defaultAlwaysOnTop = value; + this.dirty = true; + })) + containerEl.createEl("h1", { cls: "excalibrain-settings-h1", text: t("STYLE_HEAD") diff --git a/src/graph/Node.ts b/src/graph/Node.ts index de21bc5..5db933a 100644 --- a/src/graph/Node.ts +++ b/src/graph/Node.ts @@ -76,7 +76,7 @@ export class Node { const gateDiameter = this.style.gateRadius*2; ea.style.fontSize = this.style.fontSize; ea.style.fontFamily = this.style.fontFamily; - const labelSize = ea.measureText(`${label}m`); + const labelSize = ea.measureText(`${label}`); ea.style.fillStyle = this.style.fillStyle; ea.style.roughness = this.style.roughness; ea.style.strokeSharpness = this.style.strokeShaprness; diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index 05c8006..e150a67 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -95,6 +95,8 @@ export default { ALLOW_AUTOZOOM_DESC: "Toggle ON: Allow autozoom
Toggle OFF: Disable autozoom", ALLOW_AUTOFOCUS_ON_SEARCH_NAME: "Autofocus on search", ALLOW_AUTOFOCUS_ON_SEARCH_DESC: "Toggle ON: Allow autofocus on Search
Toggle OFF: Disable autofocus", + ALWAYS_ON_TOP_NAME: "Popout default 'always on top' behavior", + ALWAYS_ON_TOP_DESC: "Toggle ON: When opening ExcaliBrain in a popout window, it will open with the new window in 'always on top' mode.
Toggle OFF: The new window will not be in 'always on top' mode.", TAGLIST_NAME: "Formatted tags", TAGLIST_DESC: "You can specify special formatting rules for Nodes based on tags. If multiple tags are present on the page the first matching a specification " + "will be used.
Tagnames should start with # and may be incomplete. i.e. #book will match #books, #book/fiction, etc.
" +