[gnome-software] Experiments with shadows



commit 66564440a35ae8293a2ff1c9344c66d443628640
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 6 01:07:56 2013 -0400

    Experiments with shadows
    
    A first cut at adding shadows to the tiles. Still a bit rough.

 src/Makefile.am                  |    1 +
 src/gnome-software.gresource.xml |    1 +
 src/gs-shell-category.c          |    1 +
 src/gs-shell-overview.c          |    2 ++
 src/gtk-style.css                |    5 +++++
 src/shadow.png                   |  Bin 0 -> 437 bytes
 6 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2803401..60ed8d3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -116,6 +116,7 @@ EXTRA_DIST =                                                \
        gnome-software.gresource.xml                    \
        gnome-software.xml                              \
        gtk-style.css                                   \
+       shadow.png                                      \
        $(desktop_in_files)                             \
        $(UI_FILES)
 
diff --git a/src/gnome-software.gresource.xml b/src/gnome-software.gresource.xml
index 7c14b5b..e61d3b7 100644
--- a/src/gnome-software.gresource.xml
+++ b/src/gnome-software.gresource.xml
@@ -4,5 +4,6 @@
   <file preprocess="xml-stripblanks">gnome-software.ui</file>
   <file preprocess="xml-stripblanks">app-menu.ui</file>
   <file>gtk-style.css</file>
+  <file>shadow.png</file>
  </gresource>
 </gresources>
diff --git a/src/gs-shell-category.c b/src/gs-shell-category.c
index c913657..47501ff 100644
--- a/src/gs-shell-category.c
+++ b/src/gs-shell-category.c
@@ -81,6 +81,7 @@ create_app_tile (GsShellCategory *shell, GsApp *app)
         gtk_container_add (GTK_CONTAINER (button), frame);
         gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
         gtk_style_context_add_class (gtk_widget_get_style_context (frame), "view");
+        gtk_style_context_add_class (gtk_widget_get_style_context (frame), "tile");
         grid = gtk_grid_new ();
         gtk_container_add (GTK_CONTAINER (frame), grid);
         g_object_set (grid, "margin", 12, "row-spacing", 6, "column-spacing", 6, NULL);
diff --git a/src/gs-shell-overview.c b/src/gs-shell-overview.c
index 35d38f3..0d8c5a2 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-shell-overview.c
@@ -125,6 +125,7 @@ create_popular_tile (GsShellOverview *shell_overview, GsApp *app)
        frame = gtk_aspect_frame_new (NULL, 0.5, 1, 1, FALSE);
        gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
        gtk_style_context_add_class (gtk_widget_get_style_context (frame), "view");
+       gtk_style_context_add_class (gtk_widget_get_style_context (frame), "tile");
        gtk_widget_set_halign (frame, GTK_ALIGN_FILL);
        gtk_widget_set_valign (frame, GTK_ALIGN_FILL);
         o = gtk_overlay_new ();
@@ -240,6 +241,7 @@ create_category_tile (GsShellOverview *shell_overview, GsCategory *category)
        gtk_container_add (GTK_CONTAINER (button), frame);
        gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
        gtk_style_context_add_class (gtk_widget_get_style_context (frame), "view");
+       gtk_style_context_add_class (gtk_widget_get_style_context (frame), "tile");
        label = gtk_label_new (gs_category_get_name (category));
        g_object_set (label, "margin", 12, "xalign", 0, NULL);
        gtk_container_add (GTK_CONTAINER (frame), label);
diff --git a/src/gtk-style.css b/src/gtk-style.css
index fa6d916..4dc8681 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -55,3 +55,8 @@ GtkNotebook.main-notebook-software > GtkScrolledWindow {
         background-image: linear-gradient(to bottom, @theme_selected_bg_color, @theme_selected_bg_color);
         animation: throbbing linear 1s infinite alternate;
 }
+
+.view.tile {
+        border-width: 4;
+        border-image: url("shadow.png") 4 4 4 4 stretch;
+}
diff --git a/src/shadow.png b/src/shadow.png
new file mode 100644
index 0000000..d59e2f2
Binary files /dev/null and b/src/shadow.png differ


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