[gnome-software] Add an icon to the summary/popular tiles when an app is installed



commit 9961f18ec3707064f7545bd148f6602b626c507e
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Sat Nov 26 12:32:24 2016 +0100

    Add an icon to the summary/popular tiles when an app is installed
    
    This is used instead of the "Installed" label.

 data/icons/hicolor/scalable/Makefile.am            |    4 +-
 .../scalable/software-installed-symbolic.svg       |   70 ++++++++++++++++++++
 src/gs-popular-tile.ui                             |   24 ++++----
 src/gs-summary-tile.c                              |   11 ---
 src/gs-summary-tile.ui                             |   27 ++++----
 src/gtk-style-hc.css                               |    4 +
 src/gtk-style.css                                  |    3 +
 7 files changed, 105 insertions(+), 38 deletions(-)
---
diff --git a/data/icons/hicolor/scalable/Makefile.am b/data/icons/hicolor/scalable/Makefile.am
index c68115e..02004ef 100644
--- a/data/icons/hicolor/scalable/Makefile.am
+++ b/data/icons/hicolor/scalable/Makefile.am
@@ -1,4 +1,6 @@
 appiconsdir = $(datadir)/icons/hicolor/scalable/apps
-dist_appicons_DATA = org.gnome.Software-symbolic.svg
+dist_appicons_DATA =                                           \
+                       org.gnome.Software-symbolic.svg         \
+                       software-installed-symbolic.svg
 
 -include $(top_srcdir)/git.mk
diff --git a/data/icons/hicolor/scalable/software-installed-symbolic.svg 
b/data/icons/hicolor/scalable/software-installed-symbolic.svg
new file mode 100644
index 0000000..38989c7
--- /dev/null
+++ b/data/icons/hicolor/scalable/software-installed-symbolic.svg
@@ -0,0 +1,70 @@
+<?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 16 16"
+   version="1.1"
+   id="svg36018"
+   inkscape:version="0.92pre1 r"
+   sodipodi:docname="software-installed-symbolic.svg">
+  <defs
+     id="defs36012" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="-2.1503288"
+     inkscape:cy="-3.6096175"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     showborder="false"
+     borderlayer="true"
+     inkscape:showpageshadow="false"
+     inkscape:window-width="1440"
+     inkscape:window-height="836"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1">
+    <inkscape:grid
+       type="xygrid"
+       id="grid36020" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata36015">
+    <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
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-292.76665)">
+    <path
+       inkscape:connector-curvature="0"
+       id="path20599"
+       d="m 8,292.76665 c -1.65335,0 -3,1.34665 -3,3 v 1 H 3.09375 C 2.48781,296.76665 2,297.25446 
2,297.8604 v 9.8125 c 0,0.60594 0.48781,1.09375 1.09375,1.09375 h 9.8125 c 0.60594,0 1.09375,-0.48781 
1.09375,-1.09375 v -6.67773 l -6.44141,6.33398 -4.125,-4.07617 2.0625,-1.99414 2.03125,1.97656 
6.20313,-6.07227 c -0.20033,-0.23701 -0.48817,-0.39648 -0.82422,-0.39648 H 11 v -1 c 0,-1.65335 -1.34665,-3 
-3,-3 z m 0,1 c 1.11665,0 2,0.88335 2,2 v 1 H 6 v -1 c 0,-1.11665 0.88335,-2 2,-2 z m -2.53125,4 c 0.28679,0 
0.53125,0.22386 0.53125,0.5 0,0.27614 -0.24446,0.5 -0.53125,0.5 -0.28679,0 -0.5,-0.22386 -0.5,-0.5 0,-0.27614 
0.21321,-0.5 0.5,-0.5 z m 5,0 c 0.28679,0 0.53125,0.22386 0.53125,0.5 0,0.27614 -0.24446,0.5 -0.53125,0.5 
-0.28679,0 -0.5,-0.22386 -0.5,-0.5 0,-0.27614 0.21321,-0.5 0.5,-0.5 z"
+       
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#888a85;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999988;marker:none;enable-background:accumulate"
 />
+  </g>
+</svg>
diff --git a/src/gs-popular-tile.ui b/src/gs-popular-tile.ui
index 40bde97..2236467 100644
--- a/src/gs-popular-tile.ui
+++ b/src/gs-popular-tile.ui
@@ -37,19 +37,19 @@
                 <property name="visible_window">True</property>
                 <property name="halign">end</property>
                 <property name="valign">start</property>
-                <property name="margin-top">6</property>
-                <style>
-                  <class name="popular-installed-overlay-box"/>
-                </style>
                 <child>
-                  <object class="GtkLabel" id="installed-label">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Installed</property>
-                    <property name="margin-start">10</property>
-                    <property name="margin-end">10</property>
-                    <property name="margin-top">4</property>
-                    <property name="margin-bottom">4</property>
-                  </object>
+                 <object class="GtkImage" id="installed-icon">
+                   <property name="visible">True</property>
+                   <property name="halign">center</property>
+                   <property name="valign">center</property>
+                   <property name="pixel-size">20</property>
+                    <property name="margin-top">6</property>
+                    <property name="margin-right">6</property>
+                   <property name="icon-name">software-installed-symbolic</property>
+                   <style>
+                     <class name="installed-icon"/>
+                   </style>
+                 </object>
                 </child>
               </object>
             </child>
diff --git a/src/gs-summary-tile.c b/src/gs-summary-tile.c
index 59fb120..bb7da44 100644
--- a/src/gs-summary-tile.c
+++ b/src/gs-summary-tile.c
@@ -59,13 +59,11 @@ app_state_changed_idle (gpointer user_data)
 {
        GsSummaryTile *tile = GS_SUMMARY_TILE (user_data);
        AtkObject *accessible;
-       GtkWidget *label;
        gboolean installed;
        g_autofree gchar *name = NULL;
 
        accessible = gtk_widget_get_accessible (GTK_WIDGET (tile));
 
-       label = gtk_bin_get_child (GTK_BIN (tile->eventbox));
        switch (gs_app_get_state (tile->app)) {
        case AS_APP_STATE_INSTALLED:
        case AS_APP_STATE_UPDATABLE:
@@ -73,25 +71,16 @@ app_state_changed_idle (gpointer user_data)
                installed = TRUE;
                name = g_strdup_printf (_("%s (Installed)"),
                                        gs_app_get_name (tile->app));
-               /* TRANSLATORS: this is the small blue label on the tile
-                * that tells the user the application is installed */
-               gtk_label_set_label (GTK_LABEL (label), _("Installed"));
                break;
        case AS_APP_STATE_INSTALLING:
                installed = TRUE;
                name = g_strdup_printf (_("%s (Installing)"),
                                        gs_app_get_name (tile->app));
-               /* TRANSLATORS: this is the small blue label on the tile
-                * that tells the user the application is being installed */
-               gtk_label_set_label (GTK_LABEL (label), _("Installing"));
                break;
        case AS_APP_STATE_REMOVING:
                installed = TRUE;
                name = g_strdup_printf (_("%s (Removing)"),
                                        gs_app_get_name (tile->app));
-               /* TRANSLATORS: this is the small blue label on the tile
-                * that tells the user the application is being removed */
-               gtk_label_set_label (GTK_LABEL (label), _("Removing"));
                break;
        case AS_APP_STATE_QUEUED_FOR_INSTALL:
        case AS_APP_STATE_AVAILABLE:
diff --git a/src/gs-summary-tile.ui b/src/gs-summary-tile.ui
index fdddb39..0c704df 100644
--- a/src/gs-summary-tile.ui
+++ b/src/gs-summary-tile.ui
@@ -38,22 +38,21 @@
               <object class="GtkEventBox" id="eventbox">
                 <property name="no_show_all">True</property>
                 <property name="visible_window">True</property>
-                <property name="halign">start</property>
+                <property name="halign">end</property>
                 <property name="valign">start</property>
-                <property name="margin-top">58</property>
-                <property name="margin-start">12</property>
-                <style>
-                  <class name="installed-overlay-box"/>
-                </style>
                 <child>
-                  <object class="GtkLabel" id="installed-label">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Installed</property>
-                    <property name="margin-start">16</property>
-                    <property name="margin-end">16</property>
-                    <property name="margin-top">4</property>
-                    <property name="margin-bottom">4</property>
-                  </object>
+                 <object class="GtkImage" id="installed-icon">
+                   <property name="visible">True</property>
+                   <property name="halign">center</property>
+                   <property name="valign">center</property>
+                   <property name="pixel-size">20</property>
+                    <property name="margin-top">6</property>
+                    <property name="margin-right">6</property>
+                   <property name="icon-name">software-installed-symbolic</property>
+                   <style>
+                     <class name="installed-icon"/>
+                   </style>
+                 </object>
                 </child>
               </object>
             </child>
diff --git a/src/gtk-style-hc.css b/src/gtk-style-hc.css
index 5b8c13e..f10c966 100644
--- a/src/gtk-style-hc.css
+++ b/src/gtk-style-hc.css
@@ -13,6 +13,10 @@
        text-shadow: none;
 }
 
+.installed-icon {
+       color: #999999;
+}
+
 .index-title-alignment-software {
        font-weight: bold;
        font-size: 125%;
diff --git a/src/gtk-style.css b/src/gtk-style.css
index 9a76bb0..1cc2a25 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -9,6 +9,9 @@
         color: @theme_selected_fg_color;
   }
 
+.installed-icon {
+       color: @theme_selected_bg_color;
+}
 
 .popular-installed-overlay-box {
        font-size: smaller;


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