1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-10-06 09:27:20 +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 { RecoveryToken } from '../api/tabRecovery'
import { BaseComponent } from './base.component'
@ -71,7 +71,7 @@ export abstract class BaseTabComponent extends BaseComponent {
get blurred$ (): Observable<void> { return this.blurred }
get titleChange$ (): Observable<string> { return this.titleChange.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 recoveryStateChangedHint$ (): Observable<void> { return this.recoveryStateChangedHint }
@ -113,16 +113,20 @@ export abstract class BaseTabComponent extends BaseComponent {
* Shows the acticity marker on the tab header
*/
displayActivity (): void {
this.hasActivity = true
this.activity.next(true)
if (!this.hasActivity) {
this.hasActivity = true
this.activity.next(true)
}
}
/**
* Removes the acticity marker from the tab header
*/
clearActivity (): void {
this.hasActivity = false
this.activity.next(false)
if (this.hasActivity) {
this.hasActivity = false
this.activity.next(false)
}
}
/**

View File

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