diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-09-30 23:48:06 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-09-30 23:48:06 +0800 |
commit | 4674fb54872a093b9e116de91e7122c42be735fa (patch) | |
tree | 1b648fba3a8ecc873fff0a2b5af93270c61728c5 /widgets | |
parent | b73a8f243ea4446f39012d7a64c107c25ff6d854 (diff) | |
download | gsoc2013-evolution-4674fb54872a093b9e116de91e7122c42be735fa.tar.gz gsoc2013-evolution-4674fb54872a093b9e116de91e7122c42be735fa.tar.zst gsoc2013-evolution-4674fb54872a093b9e116de91e7122c42be735fa.zip |
ETableHeader: Nuke unused code.
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/table/e-table-header-utils.c | 149 |
1 files changed, 2 insertions, 147 deletions
diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index 431009016f..0150ff02a6 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -35,31 +35,6 @@ #include "e-table-defines.h" #include "e-table-header-utils.h" -static PangoLayout * -build_header_layout (GtkWidget *widget, - const gchar *str) -{ - PangoLayout *layout; - - layout = gtk_widget_create_pango_layout (widget, str); - -#ifdef FROB_FONT_DESC - { - PangoFontDescription *desc; - desc = pango_font_description_copy (gtk_widget_get_style (widget)->font_desc); - pango_font_description_set_size (desc, - pango_font_description_get_size (desc) * 1.2); - - pango_font_description_set_weight (desc, PANGO_WEIGHT_BOLD); - pango_layout_set_font_description (layout, desc); - - pango_font_description_free (desc); - } -#endif - - return layout; -} - static void get_button_padding (GtkWidget *widget, GtkBorder *padding) @@ -100,7 +75,7 @@ e_table_header_compute_height (ETableCol *ecol, get_button_padding (widget, &padding); - layout = build_header_layout (widget, ecol->text); + layout = gtk_widget_create_pango_layout (widget, ecol->text); pango_layout_get_pixel_size (layout, NULL, &height); @@ -126,126 +101,6 @@ e_table_header_width_extras (GtkWidget *widget) return padding.left + padding.right + 2 * HEADER_PADDING; } -/* Creates a pixmap that is a composite of a background color and the upper-left - * corner rectangle of a pixbuf. - */ -#if 0 -static GdkPixmap * -make_composite_pixmap (GdkDrawable *drawable, - GdkGC *gc, - GdkPixbuf *pixbuf, - GdkColor *bg, - gint width, - gint height, - gint dither_xofs, - gint dither_yofs) -{ - gint pwidth, pheight; - GdkPixmap *pixmap; - GdkPixbuf *tmp; - gint color; - - pwidth = gdk_pixbuf_get_width (pixbuf); - pheight = gdk_pixbuf_get_height (pixbuf); - g_return_val_if_fail (width <= pwidth && height <= pheight, NULL); - - color = ((bg->red & 0xff00) << 8) | - (bg->green & 0xff00) | - ((bg->blue & 0xff00) >> 8); - - if (width >= pwidth && height >= pheight) { - tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); - if (!tmp) - return NULL; - - gdk_pixbuf_composite_color (pixbuf, tmp, - 0, 0, - width, height, - 0, 0, - 1.0, 1.0, - GDK_INTERP_NEAREST, - 255, - 0, 0, - 16, - color, color); - } else { - gint x, y, rowstride; - GdkPixbuf *fade; - guchar *pixels; - - /* Do a nice fade of the pixbuf down and to the right */ - - fade = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height); - if (!fade) - return NULL; - - gdk_pixbuf_copy_area (pixbuf, - 0, 0, - width, height, - fade, - 0, 0); - - rowstride = gdk_pixbuf_get_rowstride (fade); - pixels = gdk_pixbuf_get_pixels (fade); - - for (y = 0; y < height; y++) { - guchar *p; - gint yfactor; - - p = pixels + y * rowstride; - - if (height < pheight) - yfactor = height - y; - else - yfactor = height; - - for (x = 0; x < width; x++) { - gint xfactor; - - if (width < pwidth) - xfactor = width - x; - else - xfactor = width; - - p[3] = ((gint) p[3] * xfactor * yfactor / (width * height)); - p += 4; - } - } - - tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); - if (!tmp) { - g_object_unref (fade); - return NULL; - } - - gdk_pixbuf_composite_color (fade, tmp, - 0, 0, - width, height, - 0, 0, - 1.0, 1.0, - GDK_INTERP_NEAREST, - 255, - 0, 0, - 16, - color, color); - - g_object_unref (fade); - } - - pixmap = gdk_pixmap_new (drawable, width, height, -1); - gdk_draw_rgb_image_dithalign (pixmap, gc, - 0, 0, - width, height, - GDK_RGB_DITHER_NORMAL, - gdk_pixbuf_get_pixels (tmp), - gdk_pixbuf_get_rowstride (tmp), - dither_xofs, dither_yofs); - g_object_unref (tmp); - - return pixmap; -} -#endif - /** * e_table_header_draw_button: * @drawable: Destination drawable. @@ -340,7 +195,7 @@ e_table_header_draw_button (cairo_t *cr, return; /* nothing else fits */ } - layout = build_header_layout (widget, ecol->text); + layout = gtk_widget_create_pango_layout (widget, ecol->text); pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); /* Pixbuf or label */ |