[gnome-shell/wip/fmuellner/calendar-refresh: 14/15] calendar: Add calendar icon to events



commit 94fc1faa51ef85ad809006e5f7787ab9f26c99d3
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Feb 26 03:33:26 2017 +0100

    calendar: Add calendar icon to events
    
    Without the boxy background, event messages look a bit plain and
    unaligned with other messages. Adding an icon addresses this,
    however as repeating the same icon over and over again in case of
    many events would be rather noisy, only show it for the top event
    as in the mockups.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775763

 js/ui/calendar.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index d7d0b4b..21add83 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -706,6 +706,14 @@ const EventMessage = new Lang.Class({
         this._date = date;
 
         this.parent(this._formatEventTime(), event.summary);
+
+        this._icon = new St.Icon({ icon_name: 'x-office-calendar-symbolic' });
+        this.setIcon(this._icon);
+
+        this.actor.connect('style-changed', () => {
+            let iconVisible = this.actor.get_parent().has_style_pseudo_class('first-child');
+            this._icon.opacity = (iconVisible ? 255 : 0);
+        });
     },
 
     _formatEventTime: function() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]