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:
parent
555a21d648
commit
00191763cf
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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(' | '))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user