Skip to content

Commit

Permalink
0.1.13 - always on top, right gate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed May 1, 2023
1 parent 09a4bf3 commit a1d369b
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
13 changes: 13 additions & 0 deletions src/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export interface ExcaliBrainSettings {
boldFields: boolean;
allowAutozoom: boolean;
allowAutofocuOnSearch: boolean;
defaultAlwaysOnTop: boolean;
}

export const DEFAULT_SETTINGS: ExcaliBrainSettings = {
Expand Down Expand Up @@ -154,6 +155,7 @@ export const DEFAULT_SETTINGS: ExcaliBrainSettings = {
boldFields: false,
allowAutozoom: true,
allowAutofocuOnSearch: true,
defaultAlwaysOnTop: false,
};

const HIDE_DISABLED_STYLE = "excalibrain-hide-disabled";
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/graph/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/lang/locale/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export default {
ALLOW_AUTOZOOM_DESC: "<b>Toggle ON:</b> Allow autozoom<br><b>Toggle OFF:</b> Disable autozoom",
ALLOW_AUTOFOCUS_ON_SEARCH_NAME: "Autofocus on search",
ALLOW_AUTOFOCUS_ON_SEARCH_DESC: "<b>Toggle ON:</b> Allow autofocus on Search<br><b>Toggle OFF:</b> Disable autofocus",
ALWAYS_ON_TOP_NAME: "Popout default 'always on top' behavior",
ALWAYS_ON_TOP_DESC: "<b>Toggle ON:</b> When opening ExcaliBrain in a popout window, it will open with the new window in 'always on top' mode.<br><b>Toggle OFF:</b> 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. <br>Tagnames should start with <mark>#</mark> and may be incomplete. i.e. <code>#book</code> will match #books, #book/fiction, etc.<br>" +
Expand Down

0 comments on commit a1d369b

Please sign in to comment.