Add file index display

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/14/head
trivernis 3 years ago
parent e0fd519e91
commit fd1d3e128c
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -12,6 +12,8 @@
<app-content-viewer (contextmenu)="this.selectedFile && fileContextMenu.onContextMenu($event, [this.selectedFile!.data])" <app-content-viewer (contextmenu)="this.selectedFile && fileContextMenu.onContextMenu($event, [this.selectedFile!.data])"
*ngIf="this.selectedFile" *ngIf="this.selectedFile"
[file]="this.selectedFile!.data"></app-content-viewer> [file]="this.selectedFile!.data"></app-content-viewer>
<div class="display-metadata">
<span>{{this.selectedIndex + 1}} of {{this.entries.length}}</span></div>
<app-flap-button (appClick)="this.togglePreviewStrip()" align="center" attach="bottom"> <app-flap-button (appClick)="this.togglePreviewStrip()" align="center" attach="bottom">
<ng-icon *ngIf="previewStripVisible" name="mat-expand-more"></ng-icon> <ng-icon *ngIf="previewStripVisible" name="mat-expand-more"></ng-icon>
<ng-icon *ngIf="!previewStripVisible" name="mat-expand-less"></ng-icon> <ng-icon *ngIf="!previewStripVisible" name="mat-expand-less"></ng-icon>

@ -92,3 +92,14 @@ app-content-viewer {
margin: auto; margin: auto;
} }
} }
.display-metadata {
position: absolute;
bottom: 0;
left: 0;
span {
margin: 0.5em;
color: $text-darker-10;
}
}

@ -45,6 +45,7 @@ export class FileGalleryComponent implements OnChanges, OnInit, AfterViewInit, A
public fileContentUrl: SafeResourceUrl | undefined; public fileContentUrl: SafeResourceUrl | undefined;
public fileChanged = new BehaviorSubject<void>(undefined); public fileChanged = new BehaviorSubject<void>(undefined);
public selectedIndex = 0;
public imageViewHeightPercent = 80; public imageViewHeightPercent = 80;
public previewStripVisible = true; public previewStripVisible = true;
public previewedEntries: (Selectable<File> | undefined)[] = []; public previewedEntries: (Selectable<File> | undefined)[] = [];
@ -103,6 +104,7 @@ export class FileGalleryComponent implements OnChanges, OnInit, AfterViewInit, A
this.selectedFile?.unselect(); this.selectedFile?.unselect();
entry.select(); entry.select();
this.selectedFile = entry; this.selectedFile = entry;
this.selectedIndex = this.entries.indexOf(entry);
await this.loadSelectedFile(); await this.loadSelectedFile();
this.fileSelect.emit(this.selectedFile.data); this.fileSelect.emit(this.selectedFile.data);

Loading…
Cancel
Save