[gnome-shell] dateMenu: Use icon for message indicator



commit bddc2c0016878c8eb629d6d4b7c0f2f38353377a
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Sep 12 12:33:37 2017 +0200

    dateMenu: Use icon for message indicator
    
    Using a unicode character here means it may look quite different
    from the intended style (for instance with emoji fonts). Avoid
    this by providing a custom icon and use that instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766368

 data/gnome-shell-theme.gresource.xml      |    1 +
 data/theme/message-indicator-symbolic.svg |   40 +++++++++++++++++++++++++++++
 js/ui/dateMenu.js                         |    6 +++-
 js/ui/main.js                             |    1 +
 4 files changed, 46 insertions(+), 2 deletions(-)
---
diff --git a/data/gnome-shell-theme.gresource.xml b/data/gnome-shell-theme.gresource.xml
index 25769a4..896a1e2 100644
--- a/data/gnome-shell-theme.gresource.xml
+++ b/data/gnome-shell-theme.gresource.xml
@@ -18,6 +18,7 @@
     <file>gnome-shell.css</file>
     <file>gnome-shell-high-contrast.css</file>
     <file>logged-in-indicator.svg</file>
+    <file alias="icons/message-indicator-symbolic.svg">message-indicator-symbolic.svg</file>
     <file>no-events.svg</file>
     <file>no-notifications.svg</file>
     <file>noise-texture.png</file>
diff --git a/data/theme/message-indicator-symbolic.svg b/data/theme/message-indicator-symbolic.svg
new file mode 100644
index 0000000..257a984
--- /dev/null
+++ b/data/theme/message-indicator-symbolic.svg
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="16"
+   height="16"
+   viewBox="0 0 4.2333333 4.2333333"
+   version="1.1"
+   id="svg8">
+  <defs
+     id="defs2" />
+  <metadata
+     id="metadata5">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     style="display:inline"
+     transform="translate(0,-292.76667)">
+    <path
+       style="fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:0.17969394"
+       d="m 3.1749998,294.88333 a 1.0583333,1.0583333 0 0 1 -1.0583332,1.05833 1.0583333,1.0583333 0 0 1 
-1.0583333,-1.05833 1.0583333,1.0583333 0 0 1 1.0583333,-1.05833 1.0583333,1.0583333 0 0 1 1.0583332,1.05833 
z"
+       id="path4485" />
+  </g>
+</svg>
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 0054f2d..0aad37e 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -337,8 +337,10 @@ var MessagesIndicator = new Lang.Class({
     Name: 'MessagesIndicator',
 
     _init: function() {
-        this.actor = new St.Label({ text: '⚫', visible: false, y_expand: true,
-                                    y_align: Clutter.ActorAlign.CENTER });
+        this.actor = new St.Icon({ icon_name: 'message-indicator-symbolic',
+                                   icon_size: 16,
+                                   visible: false, y_expand: true,
+                                   y_align: Clutter.ActorAlign.CENTER });
 
         this._sources = [];
 
diff --git a/js/ui/main.js b/js/ui/main.js
index 85dbe1f..e981db9 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -122,6 +122,7 @@ function start() {
     sessionMode.connect('updated', _sessionUpdated);
     Gtk.Settings.get_default().connect('notify::gtk-theme-name',
                                        _loadDefaultStylesheet);
+    Gtk.IconTheme.get_default().add_resource_path('/org/gnome/shell/theme/icons');
     _initializeUI();
 
     shellAccessDialogDBusService = new AccessDialog.AccessDialogDBus();


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