[gnome-software] Improve category tiles



commit c448991d0ccdd11b24d089e436e94c5a98b8bb34
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 6 01:29:17 2013 -0400

    Improve category tiles
    
    Get rid of the button-esque decoration, and add a nicer
    hover style.

 src/gs-shell-category.c |   12 ++++--------
 src/gtk-style.css       |    6 ++++++
 2 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-shell-category.c b/src/gs-shell-category.c
index 47501ff..46afa1d 100644
--- a/src/gs-shell-category.c
+++ b/src/gs-shell-category.c
@@ -69,21 +69,17 @@ app_tile_clicked (GtkButton *button, gpointer data)
 static GtkWidget *
 create_app_tile (GsShellCategory *shell, GsApp *app)
 {
-        GtkWidget *button, *frame, *label;
+        GtkWidget *button, *label;
         GtkWidget *image, *grid;
         const gchar *tmp;
         PangoAttrList *attrs;
 
         button = gtk_button_new ();
         gtk_widget_set_hexpand (button, TRUE);
-        gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
-        frame = gtk_frame_new (NULL);
-        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");
+        gtk_style_context_add_class (gtk_widget_get_style_context (button), "view");
+        gtk_style_context_add_class (gtk_widget_get_style_context (button), "tile");
         grid = gtk_grid_new ();
-        gtk_container_add (GTK_CONTAINER (frame), grid);
+        gtk_container_add (GTK_CONTAINER (button), grid);
         g_object_set (grid, "margin", 12, "row-spacing", 6, "column-spacing", 6, NULL);
         image = gtk_image_new_from_pixbuf (gs_app_get_pixbuf (app));
         gtk_grid_attach (GTK_GRID (grid), image, 0, 0, 1, 2);
diff --git a/src/gtk-style.css b/src/gtk-style.css
index 4dc8681..17ea3ee 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -59,4 +59,10 @@ GtkNotebook.main-notebook-software > GtkScrolledWindow {
 .view.tile {
         border-width: 4;
         border-image: url("shadow.png") 4 4 4 4 stretch;
+        background-image: none;
+        background-color: @list_box_bg;
+}
+
+.view.tile:hover {
+        background-color: @content_view_bg;
 }


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