[gnome-photos] utils: Move the emblems some more to the lower left corner



commit 3e7b1ab74f8b145b4656d1501d29cd2a4ecaa015
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Apr 10 14:40:53 2013 +0200

    utils: Move the emblems some more to the lower left corner

 src/photos-utils.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index acc193d..a8345a5 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -163,14 +163,16 @@ photos_utils_create_symbolic_icon (const gchar *name, gint base_size)
   cairo_t *cr;
   gchar *symbolic_name;
   const gint bg_min_size = 20;
+  const gint emblem_margin = 4;
   const gint emblem_min_size = 8;
   gint bg_size;
+  gint emblem_pos;
   gint emblem_size;
   gint total_size;
 
   total_size = base_size / 2;
   bg_size = MAX (total_size / 2, bg_min_size);
-  emblem_size = MAX (bg_size - 8, emblem_min_size);
+  emblem_size = MAX (bg_size - emblem_margin * 2, emblem_min_size);
 
   surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, total_size, total_size);
   cr = cairo_create (surface);
@@ -184,7 +186,7 @@ photos_utils_create_symbolic_icon (const gchar *name, gint base_size)
 
   gtk_style_context_add_class (style, "documents-icon-bg");
 
-  gtk_render_background (style, cr, (total_size - bg_size) / 2, (total_size - bg_size) / 2, bg_size, 
bg_size);
+  gtk_render_background (style, cr, total_size - bg_size, total_size - bg_size, bg_size, bg_size);
 
   symbolic_name = g_strconcat (name, "-symbolic", NULL);
   icon = g_themed_icon_new_with_default_fallbacks (symbolic_name);
@@ -203,7 +205,8 @@ photos_utils_create_symbolic_icon (const gchar *name, gint base_size)
   if (pixbuf == NULL)
     goto out;
 
-  gtk_render_icon (style, cr, pixbuf, (total_size - emblem_size) / 2,  (total_size - emblem_size) / 2);
+  emblem_pos = total_size - emblem_size - emblem_margin;
+  gtk_render_icon (style, cr, pixbuf, emblem_pos, emblem_pos);
   g_object_unref (pixbuf);
 
   ret_val = G_ICON (gdk_pixbuf_get_from_surface (surface, 0, 0, total_size, total_size));


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