1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-10-06 17:37:15 +03:00

fixed #4629 - missing activity highlight

This commit is contained in:
Eugene Pankov 2021-09-24 23:29:41 +02:00
parent 555a21d648
commit 00191763cf
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
2 changed files with 17 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import { Observable, Subject, distinctUntilChanged, debounceTime } from 'rxjs' import { Observable, Subject, distinctUntilChanged } from 'rxjs'
import { EmbeddedViewRef, ViewContainerRef, ViewRef } from '@angular/core' import { EmbeddedViewRef, ViewContainerRef, ViewRef } from '@angular/core'
import { RecoveryToken } from '../api/tabRecovery' import { RecoveryToken } from '../api/tabRecovery'
import { BaseComponent } from './base.component' import { BaseComponent } from './base.component'
@ -71,7 +71,7 @@ export abstract class BaseTabComponent extends BaseComponent {
get blurred$ (): Observable<void> { return this.blurred } get blurred$ (): Observable<void> { return this.blurred }
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()) }
get activity$ (): Observable<boolean> { return this.activity.pipe(debounceTime(500)) } get activity$ (): Observable<boolean> { return this.activity }
get destroyed$ (): Observable<void> { return this.destroyed } get destroyed$ (): Observable<void> { return this.destroyed }
get recoveryStateChangedHint$ (): Observable<void> { return this.recoveryStateChangedHint } get recoveryStateChangedHint$ (): Observable<void> { return this.recoveryStateChangedHint }
@ -113,17 +113,21 @@ export abstract class BaseTabComponent extends BaseComponent {
* Shows the acticity marker on the tab header * Shows the acticity marker on the tab header
*/ */
displayActivity (): void { displayActivity (): void {
if (!this.hasActivity) {
this.hasActivity = true this.hasActivity = true
this.activity.next(true) this.activity.next(true)
} }
}
/** /**
* Removes the acticity marker from the tab header * Removes the acticity marker from the tab header
*/ */
clearActivity (): void { clearActivity (): void {
if (this.hasActivity) {
this.hasActivity = false this.hasActivity = false
this.activity.next(false) this.activity.next(false)
} }
}
/** /**
* Override this and implement a [[TabRecoveryProvider]] to enable recovery * Override this and implement a [[TabRecoveryProvider]] to enable recovery

View File

@ -612,6 +612,13 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
this.layoutInternal(this.root, 0, 0, 100, 100) this.layoutInternal(this.root, 0, 0, 100, 100)
} }
clearActivity (): void {
for (const tab of this.getAllTabs()) {
tab.clearActivity()
}
super.clearActivity()
}
private updateTitle (): void { private updateTitle (): void {
this.setTitle(this.getAllTabs().map(x => x.title).join(' | ')) this.setTitle(this.getAllTabs().map(x => x.title).join(' | '))
} }