gimp r25116 - in trunk: . app/display app/widgets



Author: neo
Date: Wed Mar 19 09:29:30 2008
New Revision: 25116
URL: http://svn.gnome.org/viewvc/gimp?rev=25116&view=rev

Log:
2008-03-19  Sven Neumann  <sven gimp org>

	* app/widgets/gimpdockable.c
	* app/widgets/gimpwidgets-utils.[ch]: moved utility function for
	setting attributes on a PangoLayout out of gimpdockable.c.

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): use a
	bold font and paint the layout with transparency.


Modified:
   trunk/ChangeLog
   trunk/app/display/gimpcanvas.c
   trunk/app/widgets/gimpdockable.c
   trunk/app/widgets/gimpwidgets-utils.c
   trunk/app/widgets/gimpwidgets-utils.h

Modified: trunk/app/display/gimpcanvas.c
==============================================================================
--- trunk/app/display/gimpcanvas.c	(original)
+++ trunk/app/display/gimpcanvas.c	Wed Mar 19 09:29:30 2008
@@ -838,13 +838,18 @@
                             cairo_t    *cr)
 {
   GtkWidget *widget = GTK_WIDGET (canvas);
+  GdkColor  *color  = &widget->style->fg[widget->state];
   gint       width;
   gint       height;
   gdouble    factor;
 
   if (! canvas->drop_zone_layout)
-    canvas->drop_zone_layout = gtk_widget_create_pango_layout (widget,
-                                                               _("Drop Files"));
+    {
+      canvas->drop_zone_layout = gtk_widget_create_pango_layout (widget,
+                                                                 _("Drag images here"));
+      gimp_pango_layout_set_weight (canvas->drop_zone_layout,
+                                    PANGO_WEIGHT_BOLD);
+    }
 
   pango_layout_get_pixel_size (canvas->drop_zone_layout, &width, &height);
 
@@ -852,13 +857,16 @@
                 2.0 / 3.0 * widget->allocation.height / height);
 
   cairo_scale (cr, factor, factor);
-
   cairo_move_to (cr,
                  (widget->allocation.width  / factor - width)  / 2.0,
                  (widget->allocation.height / factor - height) / 2.0);
 
+  cairo_set_source_rgba (cr,
+                         color->red   / 65535.0,
+                         color->green / 65535.0,
+                         color->blue  / 65535.0,
+                         0.1);
   pango_cairo_show_layout (cr, canvas->drop_zone_layout);
-  cairo_fill (cr);
 }
 
 /**

Modified: trunk/app/widgets/gimpdockable.c
==============================================================================
--- trunk/app/widgets/gimpdockable.c	(original)
+++ trunk/app/widgets/gimpdockable.c	Wed Mar 19 09:29:30 2008
@@ -446,24 +446,6 @@
     }
 }
 
-static void
-gimp_dockable_layout_set_weight (PangoLayout *layout,
-                                 PangoWeight  weight)
-{
-  PangoAttrList  *attrs;
-  PangoAttribute *attr;
-
-  attrs = pango_attr_list_new ();
-
-  attr = pango_attr_weight_new (PANGO_WEIGHT_SEMIBOLD);
-  attr->start_index = 0;
-  attr->end_index   = -1;
-  pango_attr_list_insert (attrs, attr);
-
-  pango_layout_set_attributes (layout, attrs);
-  pango_attr_list_unref (attrs);
-}
-
 static PangoLayout *
 gimp_dockable_create_title_layout (GimpDockable *dockable,
                                    GtkWidget    *widget,
@@ -480,7 +462,7 @@
                                            title ? title : dockable->blurb);
   g_free (title);
 
-  gimp_dockable_layout_set_weight (layout, PANGO_WEIGHT_SEMIBOLD);
+  gimp_pango_layout_set_weight (layout, PANGO_WEIGHT_SEMIBOLD);
 
   if (width > 0)
     {

Modified: trunk/app/widgets/gimpwidgets-utils.c
==============================================================================
--- trunk/app/widgets/gimpwidgets-utils.c	(original)
+++ trunk/app/widgets/gimpwidgets-utils.c	Wed Mar 19 09:29:30 2008
@@ -1072,3 +1072,21 @@
 
   g_return_val_if_reached (GIMP_STOCK_WARNING);
 }
+
+void
+gimp_pango_layout_set_weight (PangoLayout *layout,
+                              PangoWeight  weight)
+{
+  PangoAttrList  *attrs;
+  PangoAttribute *attr;
+
+  attrs = pango_attr_list_new ();
+
+  attr = pango_attr_weight_new (PANGO_WEIGHT_SEMIBOLD);
+  attr->start_index = 0;
+  attr->end_index   = -1;
+  pango_attr_list_insert (attrs, attr);
+
+  pango_layout_set_attributes (layout, attrs);
+  pango_attr_list_unref (attrs);
+}

Modified: trunk/app/widgets/gimpwidgets-utils.h
==============================================================================
--- trunk/app/widgets/gimpwidgets-utils.h	(original)
+++ trunk/app/widgets/gimpwidgets-utils.h	Wed Mar 19 09:29:30 2008
@@ -90,5 +90,8 @@
 
 const gchar     * gimp_get_message_stock_id  (GimpMessageSeverity  severity);
 
+void          gimp_pango_layout_set_weight   (PangoLayout     *layout,
+                                              PangoWeight      weight);
+
 
 #endif /* __GIMP_WIDGETS_UTILS_H__ */



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