1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-10 12:16:34 +03:00

fixed tab focus loss - fixes #2525

This commit is contained in:
Eugene Pankov 2020-05-06 16:21:48 +02:00
parent 9e2d070ed4
commit 3a76e0bb2e
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -529,21 +529,24 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
if (child instanceof SplitContainer) {
this.layoutInternal(child, childX, childY, childW, childH)
} else {
const element = this.viewRefs.get(child)!.rootNodes[0]
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}%`
const viewRef = this.viewRefs.get(child)
if (viewRef) {
const element = viewRef.rootNodes[0]
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}%`
if (child === this.maximizedTab) {
element.style.left = '5%'
element.style.top = '5%'
element.style.width = '90%'
element.style.height = '90%'
if (child === this.maximizedTab) {
element.style.left = '5%'
element.style.top = '5%'
element.style.width = '90%'
element.style.height = '90%'
}
}
}
offset += sizes[i]