From 676bbba7a4f785c555557fc02e9fd1846635b1f2 Mon Sep 17 00:00:00 2001 From: Gobius Dolhain Date: Mon, 20 Apr 2020 18:38:02 +0200 Subject: [PATCH 1/2] Add dock always on top setting --- app/lib/window.ts | 9 +++++++-- terminus-core/src/configDefaults.yaml | 1 + terminus-core/src/services/docking.service.ts | 4 +++- .../src/components/settingsTab.component.pug | 9 +++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/lib/window.ts b/app/lib/window.ts index 46234440..c90baaca 100644 --- a/app/lib/window.ts +++ b/app/lib/window.ts @@ -193,8 +193,13 @@ export class Window { this.window.focus() }) } else { - // docked, visible - this.window.hide() + if (this.configStore.appearance?.dockAlwaysOnTop) { + // docked, visible, on top + this.window.hide() + } else { + // docked, visible, not on top + this.window.focus() + } } } } diff --git a/terminus-core/src/configDefaults.yaml b/terminus-core/src/configDefaults.yaml index 3cba8f8a..57ab6d01 100644 --- a/terminus-core/src/configDefaults.yaml +++ b/terminus-core/src/configDefaults.yaml @@ -2,6 +2,7 @@ appearance: dock: off dockScreen: current dockFill: 0.5 + dockAlwaysOnTop: true tabsLocation: top cycleTabs: true theme: Standard diff --git a/terminus-core/src/services/docking.service.ts b/terminus-core/src/services/docking.service.ts index a015ebfc..85131ed1 100644 --- a/terminus-core/src/services/docking.service.ts +++ b/terminus-core/src/services/docking.service.ts @@ -53,7 +53,9 @@ export class DockingService { newBounds.y = display.bounds.y } - this.hostApp.setAlwaysOnTop(true) + const alwaysOnTop = this.config.store.appearance.dockAlwaysOnTop + + this.hostApp.setAlwaysOnTop(alwaysOnTop) setImmediate(() => { this.hostApp.setBounds(newBounds) }) diff --git a/terminus-settings/src/components/settingsTab.component.pug b/terminus-settings/src/components/settingsTab.component.pug index ad0e6f60..edf49caf 100644 --- a/terminus-settings/src/components/settingsTab.component.pug +++ b/terminus-settings/src/components/settingsTab.component.pug @@ -207,6 +207,15 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab') ) | {{screen.name}} + .form-line(*ngIf='config.store.appearance.dock != "off"') + .header + .title Dock always on top + .description Keep docked terminal always on top + toggle( + [(ngModel)]='config.store.appearance.dockAlwaysOnTop', + (ngModelChange)='config.save(); docking.dock()', + ) + .form-line(*ngIf='config.store.appearance.dock != "off"') .header .title Docked terminal size From 7b9ff043ad6471de27aacaa8cd16283be0233551 Mon Sep 17 00:00:00 2001 From: Gobius Dolhain Date: Mon, 20 Apr 2020 19:19:41 +0200 Subject: [PATCH 2/2] eslint: fix whitespace --- app/lib/window.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/window.ts b/app/lib/window.ts index c90baaca..ba648116 100644 --- a/app/lib/window.ts +++ b/app/lib/window.ts @@ -193,7 +193,7 @@ export class Window { this.window.focus() }) } else { - if (this.configStore.appearance?.dockAlwaysOnTop) { + if (this.configStore.appearance?.dockAlwaysOnTop) { // docked, visible, on top this.window.hide() } else {