From d343873e7c213cfe6039d846d64913040e0e6c37 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 22 Jan 2019 15:36:57 +0100 Subject: [PATCH 1/2] Add icon to restore activity Signed-off-by: Joas Schilling --- apps/files/lib/Activity/Provider.php | 9 ++++++--- core/img/actions/history.png | Bin 0 -> 358 bytes 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 core/img/actions/history.png diff --git a/apps/files/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php index e868e1c464..469c26cb47 100644 --- a/apps/files/lib/Activity/Provider.php +++ b/apps/files/lib/Activity/Provider.php @@ -113,11 +113,11 @@ class Provider implements IProvider { return $this->parseLongVersion($event, $previousEvent); } - protected function setIcon(IEvent $event, $icon) { + protected function setIcon(IEvent $event, string $icon, string $app = 'files') { if ($this->activityManager->getRequirePNG()) { - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', $icon . '.png'))); + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath($app, $icon . '.png'))); } else { - $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', $icon . '.svg'))); + $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath($app, $icon . '.svg'))); } } @@ -142,6 +142,7 @@ class Provider implements IProvider { $this->setIcon($event, 'delete-color'); } else if ($event->getSubject() === 'restored_by') { $subject = $this->l->t('Restored by {user}'); + $this->setIcon($event, 'actions/history', 'core'); } else if ($event->getSubject() === 'renamed_by') { $subject = $this->l->t('Renamed by {user}'); $this->setIcon($event, 'change'); @@ -214,8 +215,10 @@ class Provider implements IProvider { $this->setIcon($event, 'delete-color'); } else if ($event->getSubject() === 'restored_self') { $subject = $this->l->t('You restored {file}'); + $this->setIcon($event, 'actions/history', 'core'); } else if ($event->getSubject() === 'restored_by') { $subject = $this->l->t('{user} restored {file}'); + $this->setIcon($event, 'actions/history', 'core'); } else if ($event->getSubject() === 'renamed_self') { $subject = $this->l->t('You renamed {oldfile} to {newfile}'); $this->setIcon($event, 'change'); diff --git a/core/img/actions/history.png b/core/img/actions/history.png new file mode 100644 index 0000000000000000000000000000000000000000..11eb83309fb3b79f1ec5fb1e0fbfd012e8d2c662 GIT binary patch literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ z@RfovFA^X9w(z#!_##F7cy`)x zi<6ezky;-b4o@-3pPI<}+;X4${SxzkGiw=7v$;01$p3HwdY8e|)z4*}Q$iB}1`?2E literal 0 HcmV?d00001 From 4ab1970c4358d6d70d2ab0301e4b6945c81a50da Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 22 Jan 2019 16:13:29 +0100 Subject: [PATCH 2/2] Make the yellow favorite icon non-monochrome Signed-off-by: Joas Schilling --- apps/files/lib/Activity/FavoriteProvider.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/files/lib/Activity/FavoriteProvider.php b/apps/files/lib/Activity/FavoriteProvider.php index 787978babe..3ad6b9bb83 100644 --- a/apps/files/lib/Activity/FavoriteProvider.php +++ b/apps/files/lib/Activity/FavoriteProvider.php @@ -106,6 +106,7 @@ class FavoriteProvider implements IProvider { $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))); } } else if ($event->getSubject() === self::SUBJECT_REMOVED) { + $event->setType('unfavorite'); $event->setParsedSubject($this->l->t('Removed from favorites')); if ($this->activityManager->getRequirePNG()) { $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png'))); @@ -136,6 +137,7 @@ class FavoriteProvider implements IProvider { $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))); } } else if ($event->getSubject() === self::SUBJECT_REMOVED) { + $event->setType('unfavorite'); $subject = $this->l->t('You removed {file} from your favorites'); if ($this->activityManager->getRequirePNG()) { $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png')));