gimp r25829 - in trunk: . libgimpwidgets themes/Default



Author: neo
Date: Tue May 27 13:24:18 2008
New Revision: 25829
URL: http://svn.gnome.org/viewvc/gimp?rev=25829&view=rev

Log:
2008-05-27  Sven Neumann  <sven gimp org>

	* libgimpwidgets/gimpruler.[ch]
	* libgimpwidgets/gimphruler.c (gimp_hruler_draw_ticks)
	* libgimpwidgets/gimpvruler.c (gimp_vruler_draw_ticks): use an
	extra small font for the tick labels.

	* themes/Default/gtkrc: don't hardcode a font size for the rulers.


Modified:
   trunk/ChangeLog
   trunk/libgimpwidgets/gimphruler.c
   trunk/libgimpwidgets/gimpruler.c
   trunk/libgimpwidgets/gimpruler.h
   trunk/libgimpwidgets/gimpvruler.c
   trunk/themes/Default/gtkrc

Modified: trunk/libgimpwidgets/gimphruler.c
==============================================================================
--- trunk/libgimpwidgets/gimphruler.c	(original)
+++ trunk/libgimpwidgets/gimphruler.c	Tue May 27 13:24:18 2008
@@ -143,7 +143,7 @@
   xthickness = widget->style->xthickness;
   ythickness = widget->style->ythickness;
 
-  layout = gtk_widget_create_pango_layout (widget, "012456789");
+  layout = _gimp_ruler_create_pango_layout (widget, "012456789");
   pango_layout_get_extents (layout, &ink_rect, &logical_rect);
 
   digit_height = PANGO_PIXELS (ink_rect.height) + 2;

Modified: trunk/libgimpwidgets/gimpruler.c
==============================================================================
--- trunk/libgimpwidgets/gimpruler.c	(original)
+++ trunk/libgimpwidgets/gimpruler.c	Tue May 27 13:24:18 2008
@@ -402,6 +402,29 @@
   return GIMP_RULER_GET_PRIVATE (ruler)->metric;
 }
 
+PangoLayout *
+_gimp_ruler_create_pango_layout (GtkWidget   *widget,
+                                 const gchar *text)
+{
+  PangoLayout    *layout;
+  PangoAttrList  *attrs;
+  PangoAttribute *attr;
+
+  layout = gtk_widget_create_pango_layout (widget, text);
+
+  attrs = pango_attr_list_new ();
+
+  attr = pango_attr_scale_new (PANGO_SCALE_X_SMALL);
+  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);
+
+  return layout;
+}
+
 static void
 gimp_ruler_realize (GtkWidget *widget)
 {

Modified: trunk/libgimpwidgets/gimpruler.h
==============================================================================
--- trunk/libgimpwidgets/gimpruler.h	(original)
+++ trunk/libgimpwidgets/gimpruler.h	Tue May 27 13:24:18 2008
@@ -83,8 +83,10 @@
                                       gdouble        *position,
                                       gdouble        *max_size);
 
-GdkDrawable     * _gimp_ruler_get_backing_store (GimpRuler *ruler) G_GNUC_INTERNAL;
-GimpRulerMetric * _gimp_ruler_get_metric        (GimpRuler *ruler) G_GNUC_INTERNAL;
+GdkDrawable     * _gimp_ruler_get_backing_store   (GimpRuler   *ruler) G_GNUC_INTERNAL;
+GimpRulerMetric * _gimp_ruler_get_metric          (GimpRuler   *ruler) G_GNUC_INTERNAL;
+PangoLayout     * _gimp_ruler_create_pango_layout (GtkWidget   *widget,
+                                                   const gchar *text)  G_GNUC_INTERNAL;
 
 G_END_DECLS
 

Modified: trunk/libgimpwidgets/gimpvruler.c
==============================================================================
--- trunk/libgimpwidgets/gimpvruler.c	(original)
+++ trunk/libgimpwidgets/gimpvruler.c	Tue May 27 13:24:18 2008
@@ -143,7 +143,7 @@
   xthickness = widget->style->xthickness;
   ythickness = widget->style->ythickness;
 
-  layout = gtk_widget_create_pango_layout (widget, "012456789");
+  layout = _gimp_ruler_create_pango_layout (widget, "012456789");
   pango_layout_get_extents (layout, &ink_rect, &logical_rect);
 
   digit_height = PANGO_PIXELS (ink_rect.height) + 2;
@@ -241,7 +241,6 @@
 		  pango_layout_set_text (layout, unit_str + j, 1);
 		  pango_layout_get_extents (layout, NULL, &logical_rect);
 
-
                   gtk_paint_layout (widget->style,
                                     backing_store,
                                     GTK_WIDGET_STATE (widget),

Modified: trunk/themes/Default/gtkrc
==============================================================================
--- trunk/themes/Default/gtkrc	(original)
+++ trunk/themes/Default/gtkrc	Tue May 27 13:24:18 2008
@@ -61,14 +61,6 @@
 class "GtkWidget" style "gimp-default-style"
 
 
-style "gimp-tiny-font-style"
-{
-  font_name = "sans 8"
-}
-
-class "*Ruler*" style "gimp-tiny-font-style"
-
-
 style "gimp-tool-dialog-style" = "gimp-default-style"
 {
   GtkDialog::action_area_border = 6



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