mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 17:16:03 +00:00
added a shortcut to maximize a pane (fixes #819)
This commit is contained in:
@@ -3,3 +3,24 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
flex: auto;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -156,6 +156,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
_spanners: SplitSpannerInfo[] = []
|
_spanners: SplitSpannerInfo[] = []
|
||||||
|
|
||||||
private focusedTab: BaseTabComponent
|
private focusedTab: BaseTabComponent
|
||||||
|
private maximizedTab: BaseTabComponent|null = null
|
||||||
private hotkeysSubscription: Subscription
|
private hotkeysSubscription: Subscription
|
||||||
private viewRefs: Map<BaseTabComponent, EmbeddedViewRef<any>> = new Map()
|
private viewRefs: Map<BaseTabComponent, EmbeddedViewRef<any>> = new Map()
|
||||||
|
|
||||||
@@ -226,6 +227,13 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
case 'pane-nav-down':
|
case 'pane-nav-down':
|
||||||
this.navigate('b')
|
this.navigate('b')
|
||||||
break
|
break
|
||||||
|
case 'pane-maximize':
|
||||||
|
if (this.maximizedTab) {
|
||||||
|
this.maximize(null)
|
||||||
|
} else if (this.getAllTabs().length > 1) {
|
||||||
|
this.maximize(this.focusedTab)
|
||||||
|
}
|
||||||
|
break
|
||||||
case 'close-pane':
|
case 'close-pane':
|
||||||
this.removeTab(this.focusedTab)
|
this.removeTab(this.focusedTab)
|
||||||
break
|
break
|
||||||
@@ -272,6 +280,15 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
tab.emitFocused()
|
tab.emitFocused()
|
||||||
this.focusChanged.next(tab)
|
this.focusChanged.next(tab)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.maximizedTab !== tab) {
|
||||||
|
this.maximizedTab = null
|
||||||
|
}
|
||||||
|
this.layout()
|
||||||
|
}
|
||||||
|
|
||||||
|
maximize (tab: BaseTabComponent|null) {
|
||||||
|
this.maximizedTab = tab
|
||||||
this.layout()
|
this.layout()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,13 +510,21 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
this.layoutInternal(child, childX, childY, childW, childH)
|
this.layoutInternal(child, childX, childY, childW, childH)
|
||||||
} else {
|
} else {
|
||||||
const element = this.viewRefs.get(child)!.rootNodes[0]
|
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.left = `${childX}%`
|
||||||
element.style.top = `${childY}%`
|
element.style.top = `${childY}%`
|
||||||
element.style.width = `${childW}%`
|
element.style.width = `${childW}%`
|
||||||
element.style.height = `${childH}%`
|
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]
|
offset += sizes[i]
|
||||||
|
|
||||||
|
@@ -50,5 +50,7 @@ hotkeys:
|
|||||||
- 'Ctrl-Alt-Up'
|
- 'Ctrl-Alt-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- 'Ctrl-Alt-Left'
|
- 'Ctrl-Alt-Left'
|
||||||
|
pane-maximize:
|
||||||
|
- 'Ctrl-Alt-Enter'
|
||||||
close-pane: []
|
close-pane: []
|
||||||
pluginBlacklist: ['ssh']
|
pluginBlacklist: ['ssh']
|
||||||
|
@@ -48,6 +48,8 @@ hotkeys:
|
|||||||
- '⌘-⌥-Up'
|
- '⌘-⌥-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- '⌘-⌥-Left'
|
- '⌘-⌥-Left'
|
||||||
|
pane-maximize:
|
||||||
|
- '⌘-⌥-Enter'
|
||||||
close-pane:
|
close-pane:
|
||||||
- '⌘-Shift-W'
|
- '⌘-Shift-W'
|
||||||
pluginBlacklist: ['ssh']
|
pluginBlacklist: ['ssh']
|
||||||
|
@@ -5,6 +5,7 @@ hotkeys:
|
|||||||
- 'Ctrl+Space'
|
- 'Ctrl+Space'
|
||||||
toggle-fullscreen:
|
toggle-fullscreen:
|
||||||
- 'F11'
|
- 'F11'
|
||||||
|
- 'Alt-Enter'
|
||||||
close-tab:
|
close-tab:
|
||||||
- 'Ctrl-Shift-W'
|
- 'Ctrl-Shift-W'
|
||||||
toggle-last-tab: []
|
toggle-last-tab: []
|
||||||
@@ -50,5 +51,7 @@ hotkeys:
|
|||||||
- 'Ctrl-Alt-Up'
|
- 'Ctrl-Alt-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- 'Ctrl-Alt-Left'
|
- 'Ctrl-Alt-Left'
|
||||||
|
pane-maximize:
|
||||||
|
- 'Ctrl-Alt-Enter'
|
||||||
close-pane: []
|
close-pane: []
|
||||||
pluginBlacklist: []
|
pluginBlacklist: []
|
||||||
|
@@ -93,6 +93,10 @@ export class AppHotkeyProvider extends HotkeyProvider {
|
|||||||
id: 'split-top',
|
id: 'split-top',
|
||||||
name: 'Split to the top',
|
name: 'Split to the top',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'pane-maximize',
|
||||||
|
name: 'Maximize the active pane',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'pane-nav-up',
|
id: 'pane-nav-up',
|
||||||
name: 'Focus the pane above',
|
name: 'Focus the pane above',
|
||||||
|
@@ -214,7 +214,7 @@ export class XTermFrontend extends Frontend {
|
|||||||
|
|
||||||
const theme: ITheme = {
|
const theme: ITheme = {
|
||||||
foreground: config.terminal.colorScheme.foreground,
|
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,
|
cursor: config.terminal.colorScheme.cursor,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user