new tab color and activity indicators

This commit is contained in:
Eugene Pankov 2021-04-05 12:47:16 +02:00
parent 0ff81abb0c
commit e99908761d
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
6 changed files with 38 additions and 24 deletions

View file

@ -25,7 +25,6 @@ title-bar(
[index]='idx', [index]='idx',
[tab]='tab', [tab]='tab',
[active]='tab == app.activeTab', [active]='tab == app.activeTab',
[hasActivity]='tab.activity$|async',
@animateTab, @animateTab,
[@.disabled]='hasVerticalTabs()', [@.disabled]='hasVerticalTabs()',
(click)='app.selectTab(tab)', (click)='app.selectTab(tab)',

View file

@ -1,8 +1,8 @@
.colorbar([style.background-color]='tab.color', *ngIf='tab.color != null')
.progressbar([style.width]='progress + "%"', *ngIf='progress != null') .progressbar([style.width]='progress + "%"', *ngIf='progress != null')
.index(*ngIf='!config.store.terminal.hideTabIndex', .activity-indicator(*ngIf='tab.activity$|async')
#handle,
[style.background-color]='tab.color', .index(*ngIf='!config.store.terminal.hideTabIndex', #handle) {{index + 1}}
) {{index + 1}}
.name( .name(
[title]='tab.customTitle || tab.title', [title]='tab.customTitle || tab.title',
[class.no-hover]='config.store.terminal.hideCloseButton' [class.no-hover]='config.store.terminal.hideCloseButton'

View file

@ -4,6 +4,8 @@ $tabs-height: 38px;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
> * { cursor: pointer; }
flex: 1000 1 200px; flex: 1000 1 200px;
width: 200px; width: 200px;
padding: 0 10px; padding: 0 10px;
@ -101,8 +103,30 @@ $tabs-height: 38px;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
height: 5px; height: 3px;
z-index: -1; z-index: 1;
transition: 0.25s width; transition: 0.25s width;
} }
.colorbar {
position: absolute;
left: 0;
bottom: 0;
height: 3px;
width: 100%;
z-index: 1;
}
&.active .activity-indicator {
display: none;
}
.activity-indicator {
position: absolute;
left: 10px;
right: 10px;
bottom: 4px;
height: 2px;
z-index: -1;
}
} }

View file

@ -26,7 +26,6 @@ export interface SortableComponentProxy {
export class TabHeaderComponent { export class TabHeaderComponent {
@Input() index: number @Input() index: number
@Input() @HostBinding('class.active') active: boolean @Input() @HostBinding('class.active') active: boolean
@Input() @HostBinding('class.has-activity') hasActivity: boolean
@Input() tab: BaseTabComponent @Input() tab: BaseTabComponent
@Input() progress: number|null @Input() progress: number|null
@ViewChild('handle') handle?: ElementRef @ViewChild('handle') handle?: ElementRef

View file

@ -169,6 +169,10 @@ app-root {
background: $blue; background: $blue;
} }
.activity-indicator {
background:rgba(0, 0, 0, 0.2);
}
&.active { &.active {
color: $black; color: $black;
background: $content-bg; background: $content-bg;
@ -190,10 +194,6 @@ app-root {
&.active { &.active {
border-bottom-color: transparent; border-bottom-color: transparent;
} }
&.has-activity:not(.active) {
background: linear-gradient(to bottom, rgba(208, 0, 0, 0) 95%, #36beff 96%);
}
} }
} }
@ -208,10 +208,6 @@ app-root {
&.active { &.active {
margin-top: -1px; margin-top: -1px;
} }
&.has-activity:not(.active) {
background: linear-gradient(to top, rgba(208, 0, 0, 0) 95%, #36beff 96%);
}
} }
} }
} }

View file

@ -76,6 +76,10 @@ app-root {
background: $green; background: $green;
} }
.activity-indicator {
background:rgba(255, 255, 255, 0.2);
}
&.active { &.active {
color: white; color: white;
background: $content-bg; background: $content-bg;
@ -97,10 +101,6 @@ app-root {
&.active { &.active {
border-bottom-color: transparent; border-bottom-color: transparent;
} }
&.has-activity:not(.active) {
background: linear-gradient(to bottom, rgba(208, 0, 0, 0) 95%, #1aa99c 100%);
}
} }
} }
@ -115,10 +115,6 @@ app-root {
&.active { &.active {
margin-top: -1px; margin-top: -1px;
} }
&.has-activity:not(.active) {
background: linear-gradient(to top, rgba(208, 0, 0, 0) 95%, #1aa99c 100%);
}
} }
} }
} }