tunning TL header depending of settings
This commit is contained in:
parent
5860422d83
commit
51f048bfd5
@ -7,19 +7,20 @@
|
|||||||
<!-- <div> -->
|
<!-- <div> -->
|
||||||
<div class="stream-column__stream-header">
|
<div class="stream-column__stream-header">
|
||||||
<a class="stream-column__stream-selector" href title="return to top" (click)="goToTop()">
|
<a class="stream-column__stream-selector" href title="return to top" (click)="goToTop()">
|
||||||
|
<img *ngIf="timelineHeader === 3 || timelineHeader === 4" class="stream-column__stream-selector--avatar" src="{{avatar}}" />
|
||||||
<fa-icon class="stream-column__stream-selector--icon" [icon]="columnFaIcon"></fa-icon>
|
<fa-icon class="stream-column__stream-selector--icon" [icon]="columnFaIcon"></fa-icon>
|
||||||
<h1 class="stream-column__stream-selector--title">{{ streamElement.name.toUpperCase() }}</h1>
|
<span class="stream-column__stream-selector--text">
|
||||||
<span class="stream-column__stream-selector--subtitle"
|
<h1 class="stream-column__stream-selector--title" [class.stream-column__stream-selector--title--only]="timelineHeader === 4 || timelineHeader === 5">{{ streamElement.name.toUpperCase() }}</h1>
|
||||||
*ngIf="streamElement.instance">{{ streamElement.instance.toLowerCase() }}</span>
|
<span class="stream-column__stream-selector--subtitle" *ngIf="streamElement.instance && timelineHeader !== 4 && timelineHeader !== 5"><span *ngIf="timelineHeader === 2">{{account.username}}@</span>{{ streamElement.instance.toLowerCase() }}</span>
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="stream-column__open-menu" href title="edit column" (click)="openEditionMenu()">
|
<a class="stream-column__open-menu" href title="edit column" (click)="openEditionMenu()">
|
||||||
<fa-icon class="stream-column__open-menu--icon" [icon]="menuFaIcon"></fa-icon>
|
<fa-icon class="stream-column__open-menu--icon" [icon]="menuFaIcon"></fa-icon>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-stream-edition class="stream-edition" *ngIf="editionPanelIsOpen"
|
<app-stream-edition class="stream-edition" *ngIf="editionPanelIsOpen" [streamElement]="streamElement"
|
||||||
[streamElement]="streamElement" [displayingNotifications]="displayingNotifications"
|
[displayingNotifications]="displayingNotifications" (closed)="streamEditionClosed()">
|
||||||
(closed)="streamEditionClosed()">
|
|
||||||
</app-stream-edition>
|
</app-stream-edition>
|
||||||
|
|
||||||
<app-stream-statuses *ngIf="!displayingNotifications" class="stream-statuses" [streamElement]="streamElement"
|
<app-stream-statuses *ngIf="!displayingNotifications" class="stream-statuses" [streamElement]="streamElement"
|
||||||
@ -27,9 +28,10 @@
|
|||||||
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)">
|
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)">
|
||||||
</app-stream-statuses>
|
</app-stream-statuses>
|
||||||
|
|
||||||
<app-stream-notifications *ngIf="displayingNotifications" class="stream-statuses" [streamElement]="streamElement"
|
<app-stream-notifications *ngIf="displayingNotifications" class="stream-statuses"
|
||||||
[goToTop]="goToTopSubject.asObservable()" (browseAccountEvent)="browseAccount($event)"
|
[streamElement]="streamElement" [goToTop]="goToTopSubject.asObservable()"
|
||||||
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)">
|
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
|
||||||
|
(browseThreadEvent)="browseThread($event)">
|
||||||
|
|
||||||
</app-stream-notifications>
|
</app-stream-notifications>
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
@ -48,27 +48,58 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: whitesmoke;
|
color: whitesmoke;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
&--avatar {
|
||||||
|
width: 20px;
|
||||||
|
float: left;
|
||||||
|
margin-left: 11px;
|
||||||
|
position: relative;
|
||||||
|
// left: 11px;
|
||||||
|
top: 9px;
|
||||||
|
}
|
||||||
&--icon {
|
&--icon {
|
||||||
float: left;
|
float: left;
|
||||||
|
margin-left: 11px;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 11px;
|
// left: 11px;
|
||||||
top: 9px;
|
top: 9px;
|
||||||
}
|
}
|
||||||
|
&--text {
|
||||||
|
float: left;
|
||||||
|
margin-left: 9px;
|
||||||
|
}
|
||||||
&--title {
|
&--title {
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
position: absolute;
|
// float: left;
|
||||||
|
// margin-left: 10px;
|
||||||
|
// position: absolute;
|
||||||
|
position: relative;
|
||||||
top: 9px;
|
top: 9px;
|
||||||
left: 35px;
|
// left: 35px;
|
||||||
}
|
|
||||||
|
&--only {
|
||||||
|
top: 13px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&--subtitle {
|
&--subtitle {
|
||||||
color: $font-link-primary-hover;
|
color: $font-link-primary-hover;
|
||||||
font-size: 0.7em;
|
font-size: 0.7em;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
position: absolute;
|
// position: absolute;
|
||||||
top: 21px;
|
position: relative;
|
||||||
left: 35px;;
|
top: -2px;
|
||||||
|
// top: 21px;
|
||||||
|
// top: 10px;
|
||||||
|
// left: 35px;;
|
||||||
|
// outline: 1px solid greenyellow;
|
||||||
|
display: inline-block;
|
||||||
|
white-space: nowrap;
|
||||||
|
max-width: 240px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,11 @@ import { Subject } from "rxjs";
|
|||||||
import { faHome, faGlobe, faUser, faHashtag, faListUl, faBars, IconDefinition, faBell } from "@fortawesome/free-solid-svg-icons";
|
import { faHome, faGlobe, faUser, faHashtag, faListUl, faBars, IconDefinition, faBell } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
|
||||||
import { StreamElement, StreamTypeEnum } from "../../states/streams.state";
|
import { StreamElement, StreamTypeEnum } from "../../states/streams.state";
|
||||||
import { OpenThreadEvent } from "../../services/tools.service";
|
import { OpenThreadEvent, ToolsService } from "../../services/tools.service";
|
||||||
import { StreamStatusesComponent } from './stream-statuses/stream-statuses.component';
|
import { StreamStatusesComponent } from './stream-statuses/stream-statuses.component';
|
||||||
import { StreamNotificationsComponent } from './stream-notifications/stream-notifications.component';
|
import { StreamNotificationsComponent } from './stream-notifications/stream-notifications.component';
|
||||||
|
import { TimeLineHeaderEnum } from '../../states/settings.state';
|
||||||
|
import { AccountInfo } from '../../states/accounts.state';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-stream",
|
selector: "app-stream",
|
||||||
@ -21,6 +23,10 @@ export class StreamComponent implements OnInit {
|
|||||||
overlayHashtagToBrowse: string;
|
overlayHashtagToBrowse: string;
|
||||||
overlayThreadToBrowse: OpenThreadEvent;
|
overlayThreadToBrowse: OpenThreadEvent;
|
||||||
|
|
||||||
|
timelineHeader: TimeLineHeaderEnum;
|
||||||
|
account: AccountInfo;
|
||||||
|
avatar: string;
|
||||||
|
|
||||||
displayingNotifications: boolean;
|
displayingNotifications: boolean;
|
||||||
|
|
||||||
goToTopSubject: Subject<void> = new Subject<void>();
|
goToTopSubject: Subject<void> = new Subject<void>();
|
||||||
@ -48,26 +54,33 @@ export class StreamComponent implements OnInit {
|
|||||||
case StreamTypeEnum.list:
|
case StreamTypeEnum.list:
|
||||||
this.columnFaIcon = faListUl;
|
this.columnFaIcon = faListUl;
|
||||||
break;
|
break;
|
||||||
case StreamTypeEnum.activity:
|
case StreamTypeEnum.activity:
|
||||||
this.columnFaIcon = faBell;
|
this.columnFaIcon = faBell;
|
||||||
this.displayingNotifications = true;
|
this.displayingNotifications = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._streamElement = stream;
|
this._streamElement = stream;
|
||||||
|
this.account = this.toolsService.getAccountById(stream.accountId);
|
||||||
|
this.toolsService.getAvatar(this.account)
|
||||||
|
.then(a => {
|
||||||
|
this.avatar = a;
|
||||||
|
})
|
||||||
|
.catch(err => { });
|
||||||
}
|
}
|
||||||
get streamElement(): StreamElement {
|
get streamElement(): StreamElement {
|
||||||
return this._streamElement;
|
return this._streamElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constructor(private toolsService: ToolsService) { }
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
let settings = this.toolsService.getSettings();
|
||||||
|
this.timelineHeader = settings.timelineHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
focus(): boolean {
|
focus(): boolean {
|
||||||
if(this.overlayActive) return false;
|
if (this.overlayActive) return false;
|
||||||
|
|
||||||
if (!this.displayingNotifications) {
|
if (!this.displayingNotifications) {
|
||||||
this.streamStatusesComponent.focus();
|
this.streamStatusesComponent.focus();
|
||||||
|
@ -6,7 +6,6 @@ import { MastodonWrapperService } from './mastodon-wrapper.service';
|
|||||||
import { Account, Results, Status, Emoji } from "./models/mastodon.interfaces";
|
import { Account, Results, Status, Emoji } from "./models/mastodon.interfaces";
|
||||||
import { StatusWrapper } from '../models/common.model';
|
import { StatusWrapper } from '../models/common.model';
|
||||||
import { AccountSettings, SaveAccountSettings, GlobalSettings, SaveSettings, ContentWarningPolicy, SaveContentWarningPolicy, ContentWarningPolicyEnum, TimeLineModeEnum, TimeLineHeaderEnum } from '../states/settings.state';
|
import { AccountSettings, SaveAccountSettings, GlobalSettings, SaveSettings, ContentWarningPolicy, SaveContentWarningPolicy, ContentWarningPolicyEnum, TimeLineModeEnum, TimeLineHeaderEnum } from '../states/settings.state';
|
||||||
import { AppInfo, RegisteredAppsStateModel } from '../states/registered-apps.state';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user