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:
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 { 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
|
||||||
|
@ -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(' | '))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user