diff --git a/terminus-core/src/components/splitTab.component.scss b/terminus-core/src/components/splitTab.component.scss index 15c6d27e..ef125585 100644 --- a/terminus-core/src/components/splitTab.component.scss +++ b/terminus-core/src/components/splitTab.component.scss @@ -3,3 +3,24 @@ position: relative; flex: auto; } + +::ng-deep split-tab > .child { + position: absolute; + transition: 0.125s all; + opacity: .75; + + &.focused { + opacity: 1; + } + + &.minimized { + opacity: .1; + } + + &.maximized { + z-index: 2; + box-shadow: rgba(0, 0, 0, 0.25) 0px 0px 30px; + backdrop-filter: blur(10px); + border-radius: 10px; + } +} diff --git a/terminus-core/src/components/splitTab.component.ts b/terminus-core/src/components/splitTab.component.ts index 8e1048b9..f90a729a 100644 --- a/terminus-core/src/components/splitTab.component.ts +++ b/terminus-core/src/components/splitTab.component.ts @@ -156,6 +156,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes _spanners: SplitSpannerInfo[] = [] private focusedTab: BaseTabComponent + private maximizedTab: BaseTabComponent|null = null private hotkeysSubscription: Subscription private viewRefs: Map> = new Map() @@ -226,6 +227,13 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes case 'pane-nav-down': this.navigate('b') break + case 'pane-maximize': + if (this.maximizedTab) { + this.maximize(null) + } else if (this.getAllTabs().length > 1) { + this.maximize(this.focusedTab) + } + break case 'close-pane': this.removeTab(this.focusedTab) break @@ -272,6 +280,15 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes tab.emitFocused() this.focusChanged.next(tab) } + + if (this.maximizedTab !== tab) { + this.maximizedTab = null + } + this.layout() + } + + maximize (tab: BaseTabComponent|null) { + this.maximizedTab = tab this.layout() } @@ -493,13 +510,21 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes this.layoutInternal(child, childX, childY, childW, childH) } else { const element = this.viewRefs.get(child)!.rootNodes[0] - element.style.position = 'absolute' + element.classList.toggle('child', true) + element.classList.toggle('maximized', child === this.maximizedTab) + element.classList.toggle('minimized', this.maximizedTab && child !== this.maximizedTab) + element.classList.toggle('focused', child === this.focusedTab) element.style.left = `${childX}%` element.style.top = `${childY}%` element.style.width = `${childW}%` element.style.height = `${childH}%` - element.style.opacity = child === this.focusedTab ? 1 : 0.75 + if (child === this.maximizedTab) { + element.style.left = '5%' + element.style.top = '5%' + element.style.width = '90%' + element.style.height = '90%' + } } offset += sizes[i] diff --git a/terminus-core/src/configDefaults.linux.yaml b/terminus-core/src/configDefaults.linux.yaml index 164a790e..4918e081 100644 --- a/terminus-core/src/configDefaults.linux.yaml +++ b/terminus-core/src/configDefaults.linux.yaml @@ -50,5 +50,7 @@ hotkeys: - 'Ctrl-Alt-Up' pane-nav-left: - 'Ctrl-Alt-Left' + pane-maximize: + - 'Ctrl-Alt-Enter' close-pane: [] pluginBlacklist: ['ssh'] diff --git a/terminus-core/src/configDefaults.macos.yaml b/terminus-core/src/configDefaults.macos.yaml index acce9713..bbb02c7c 100644 --- a/terminus-core/src/configDefaults.macos.yaml +++ b/terminus-core/src/configDefaults.macos.yaml @@ -48,6 +48,8 @@ hotkeys: - '⌘-⌥-Up' pane-nav-left: - '⌘-⌥-Left' + pane-maximize: + - '⌘-⌥-Enter' close-pane: - '⌘-Shift-W' pluginBlacklist: ['ssh'] diff --git a/terminus-core/src/configDefaults.windows.yaml b/terminus-core/src/configDefaults.windows.yaml index 467a2cf9..0360f696 100644 --- a/terminus-core/src/configDefaults.windows.yaml +++ b/terminus-core/src/configDefaults.windows.yaml @@ -5,6 +5,7 @@ hotkeys: - 'Ctrl+Space' toggle-fullscreen: - 'F11' + - 'Alt-Enter' close-tab: - 'Ctrl-Shift-W' toggle-last-tab: [] @@ -50,5 +51,7 @@ hotkeys: - 'Ctrl-Alt-Up' pane-nav-left: - 'Ctrl-Alt-Left' + pane-maximize: + - 'Ctrl-Alt-Enter' close-pane: [] pluginBlacklist: [] diff --git a/terminus-core/src/hotkeys.ts b/terminus-core/src/hotkeys.ts index 1ee22240..2d2c6e06 100644 --- a/terminus-core/src/hotkeys.ts +++ b/terminus-core/src/hotkeys.ts @@ -93,6 +93,10 @@ export class AppHotkeyProvider extends HotkeyProvider { id: 'split-top', name: 'Split to the top', }, + { + id: 'pane-maximize', + name: 'Maximize the active pane', + }, { id: 'pane-nav-up', name: 'Focus the pane above', diff --git a/terminus-terminal/src/frontends/xtermFrontend.ts b/terminus-terminal/src/frontends/xtermFrontend.ts index cf820af8..adce102e 100644 --- a/terminus-terminal/src/frontends/xtermFrontend.ts +++ b/terminus-terminal/src/frontends/xtermFrontend.ts @@ -214,7 +214,7 @@ export class XTermFrontend extends Frontend { const theme: ITheme = { foreground: config.terminal.colorScheme.foreground, - background: config.terminal.background === 'colorScheme' ? config.terminal.colorScheme.background : config.appearance.vibrancy ? '#00000000' : this.themesService.findCurrentTheme().terminalBackground, + background: config.terminal.background === 'colorScheme' ? config.terminal.colorScheme.background : '#00000000', cursor: config.terminal.colorScheme.cursor, }