From 5424e2ff2ab978b8954e92acafc4ad20ed13a562 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de>
Date: Thu, 29 Aug 2019 15:07:20 +0200
Subject: [PATCH] Use beamer icon for comment-flag 'read'

---
 src/app/app.component.ts                               | 10 +++++++++-
 .../components/shared/comment/comment.component.html   |  4 ++--
 src/assets/icons/beamer-icon.svg                       |  1 +
 3 files changed, 12 insertions(+), 3 deletions(-)
 create mode 100644 src/assets/icons/beamer-icon.svg

diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 29ea7e536..13841fd02 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
 import { TranslateService } from '@ngx-translate/core';
 import { SwUpdate } from '@angular/service-worker';
 import { NotificationService } from './services/util/notification.service';
+import { MatIconRegistry } from '@angular/material';
+import { DomSanitizer } from '@angular/platform-browser';
 
 @Component({
   selector: 'app-root',
@@ -12,9 +14,15 @@ export class AppComponent implements OnInit {
 
   constructor(private translationService: TranslateService,
               private update: SwUpdate,
-              public notification: NotificationService) {
+              public notification: NotificationService,
+              private matIconRegistry: MatIconRegistry,
+              private domSanitizer: DomSanitizer) {
     translationService.setDefaultLang(this.translationService.getBrowserLang());
     sessionStorage.setItem('currentLang', this.translationService.getBrowserLang());
+    this.matIconRegistry.addSvgIcon(
+      'beamer',
+      this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/icons/beamer-icon.svg')
+    );
   }
 
   title = 'frag.jetzt';
diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html
index aa111ac2a..af68cb33a 100644
--- a/src/app/components/shared/comment/comment.component.html
+++ b/src/app/components/shared/comment/comment.component.html
@@ -11,8 +11,8 @@
         </ng-template>
       </div>
       <button mat-icon-button *ngIf="comment.read" [disabled]="true" (click)="setRead(comment)">
-        <mat-icon [ngClass]="{'read-icon': comment.read, 'not-marked' : !comment.read}"
-                  matTooltip="{{ 'comment-page.mark-read' | translate }}">speaker_notes
+        <mat-icon svgIcon="beamer" [ngClass]="{'read-icon': comment.read, 'not-marked' : !comment.read}"
+                  matTooltip="{{ 'comment-page.mark-read' | translate }}">
         </mat-icon>
       </button>
       <span class="fill-remaining-space"></span>
diff --git a/src/assets/icons/beamer-icon.svg b/src/assets/icons/beamer-icon.svg
new file mode 100644
index 000000000..2783ead49
--- /dev/null
+++ b/src/assets/icons/beamer-icon.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path d="M25.875,73.875c0,2.761-2.239,5-5,5s-5-2.239-5-5"></path><path d="M85,73.875c0,2.761-2.239,5-5,5s-5-2.239-5-5"></path><g><path d="M72.461,36.5c-7.444,0-13.5,6.056-13.5,13.5c0,7.444,6.056,13.5,13.5,13.5s13.5-6.056,13.5-13.5   C85.961,42.556,79.905,36.5,72.461,36.5z M72.461,60c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10c5.523,0,10,4.477,10,10   C82.461,55.523,77.984,60,72.461,60z"></path><path d="M83,27.5H17c-6.6,0-12,5.4-12,12v21c0,6.6,5.4,12,12,12h66c6.6,0,12-5.4,12-12v-21C95,32.9,89.6,27.5,83,27.5z M40.25,62.5   h-26c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2h26c1.1,0,2,0.9,2,2C42.25,61.6,41.35,62.5,40.25,62.5z M40.25,55.562h-26c-1.1,0-2-0.9-2-2   c0-1.1,0.9-2,2-2h26c1.1,0,2,0.9,2,2C42.25,54.662,41.35,55.562,40.25,55.562z M40.25,48.438h-26c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2   h26c1.1,0,2,0.9,2,2C42.25,47.537,41.35,48.438,40.25,48.438z M40.25,41.5h-26c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2h26   c1.1,0,2,0.9,2,2C42.25,40.6,41.35,41.5,40.25,41.5z M72.461,66.5c-9.098,0-16.5-7.402-16.5-16.5c0-9.098,7.402-16.5,16.5-16.5   s16.5,7.402,16.5,16.5C88.961,59.098,81.559,66.5,72.461,66.5z"></path></g></svg>
\ No newline at end of file
-- 
GitLab