Browse Source

Merge pull request #2437 from Goobles/dock-always-on-top-toggle

Add dock always on top setting
Eugene 5 years ago
parent
commit
1384e26dd8

+ 7 - 2
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()
+                }
             }
         }
     }

+ 1 - 0
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

+ 3 - 1
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)
         })

+ 9 - 0
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