mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-22 11:28:00 +00:00
cleanup, delay canvas rescaling
This commit is contained in:
@@ -84,6 +84,7 @@ export abstract class BaseTabComponent extends BaseComponent {
|
|||||||
|
|
||||||
get focused$ (): Observable<void> { return this.focused }
|
get focused$ (): Observable<void> { return this.focused }
|
||||||
get blurred$ (): Observable<void> { return this.blurred }
|
get blurred$ (): Observable<void> { return this.blurred }
|
||||||
|
/* @hidden */
|
||||||
get visibility$ (): Observable<boolean> { return this.visibility }
|
get visibility$ (): Observable<boolean> { return this.visibility }
|
||||||
get titleChange$ (): Observable<string> { return this.titleChange.pipe(distinctUntilChanged()) }
|
get titleChange$ (): Observable<string> { return this.titleChange.pipe(distinctUntilChanged()) }
|
||||||
get progress$ (): Observable<number|null> { return this.progress.pipe(distinctUntilChanged()) }
|
get progress$ (): Observable<number|null> { return this.progress.pipe(distinctUntilChanged()) }
|
||||||
@@ -179,6 +180,7 @@ export abstract class BaseTabComponent extends BaseComponent {
|
|||||||
this.blurred.next()
|
this.blurred.next()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @hidden */
|
||||||
emitVisibility (visibility: boolean): void {
|
emitVisibility (visibility: boolean): void {
|
||||||
this.visibility.next(visibility)
|
this.visibility.next(visibility)
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Observable, Subject, first, auditTime } from 'rxjs'
|
import { Observable, Subject, first, auditTime, debounce, interval } from 'rxjs'
|
||||||
import { Spinner } from 'cli-spinner'
|
import { Spinner } from 'cli-spinner'
|
||||||
import colors from 'ansi-colors'
|
import colors from 'ansi-colors'
|
||||||
import { NgZone, OnInit, OnDestroy, Injector, ViewChild, HostBinding, Input, ElementRef, InjectFlags, Component } from '@angular/core'
|
import { NgZone, OnInit, OnDestroy, Injector, ViewChild, HostBinding, Input, ElementRef, InjectFlags, Component } from '@angular/core'
|
||||||
@@ -14,6 +14,9 @@ import { TerminalDecorator } from './decorator'
|
|||||||
import { SearchPanelComponent } from '../components/searchPanel.component'
|
import { SearchPanelComponent } from '../components/searchPanel.component'
|
||||||
import { MultifocusService } from '../services/multifocus.service'
|
import { MultifocusService } from '../services/multifocus.service'
|
||||||
|
|
||||||
|
|
||||||
|
const INACTIVE_TAB_UNLOAD_DELAY = 1000 * 30
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class to base your custom terminal tabs on
|
* A class to base your custom terminal tabs on
|
||||||
*/
|
*/
|
||||||
@@ -409,7 +412,9 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
|||||||
this.multifocus.cancel()
|
this.multifocus.cancel()
|
||||||
})
|
})
|
||||||
|
|
||||||
this.visibility$.subscribe(visibility => {
|
this.visibility$
|
||||||
|
.pipe(debounce(visibility => interval(visibility ? 0 : INACTIVE_TAB_UNLOAD_DELAY)))
|
||||||
|
.subscribe(visibility => {
|
||||||
if (this.frontend instanceof XTermFrontend) {
|
if (this.frontend instanceof XTermFrontend) {
|
||||||
if (visibility) {
|
if (visibility) {
|
||||||
// this.frontend.resizeHandler()
|
// this.frontend.resizeHandler()
|
||||||
@@ -423,7 +428,6 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('visibility:', this.title, visibility)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user