From 762ac32d75dc9ad72e66969afda09766592fd42f Mon Sep 17 00:00:00 2001 From: Sankarasivasubramanian Pasupathilingam Date: Wed, 24 Sep 2008 11:02:48 +0000 Subject: Change License from GPL to LGPL svn path=/trunk/; revision=36443 --- widgets/table/e-cell-text.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'widgets/table/e-cell-text.c') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index d0da6beadf..fc20818625 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -1,11 +1,21 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * e-cell-text.c: Text cell renderer. - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * * * Authors: - * Miguel de Icaza - * Chris Lahey + * Miguel de Icaza + * Chris Lahey * * A lot of code taken from: * @@ -19,19 +29,8 @@ * * Author: Federico Mena * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. */ #include -- cgit v1.2.3 From f1b786f18ae7dc9043c99b9b4de07207a6656a2c Mon Sep 17 00:00:00 2001 From: Felix Riemann Date: Fri, 28 Nov 2008 09:53:49 +0000 Subject: ** Fixes bug #554464 2008-11-28 Felix Riemann ** Fixes bug #554464 * configure.in: Bump gtk+ minimum version to 2.14.0 which pulls in a recent enough Pango version. * widgets/table/e-cell-text.c: (build_layout): Let Pango handle the ellipsizing, which should be faster. svn path=/trunk/; revision=36819 --- widgets/table/e-cell-text.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'widgets/table/e-cell-text.c') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index fc20818625..a539e031eb 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -612,21 +612,8 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) pango_layout_set_width (layout, width * PANGO_SCALE); pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); - if (pango_layout_get_line_count (layout) > 1) { - PangoLayoutLine *line = pango_layout_get_line (layout, 0); - gchar *line_text = g_strdup (pango_layout_get_text (layout)); - gchar *last_char = g_utf8_find_prev_char (line_text, line_text + line->length - 1); - while (last_char && pango_layout_get_line_count (layout) > 1) { - gchar *new_text; - last_char = g_utf8_find_prev_char (line_text, last_char); - if (last_char) - *last_char = '\0'; - new_text = g_strconcat (line_text, "...", NULL); - pango_layout_set_text (layout, new_text, -1); - g_free (new_text); - } - g_free (line_text); - } + pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); + pango_layout_set_height (layout, 0); switch (ect->justify) { case GTK_JUSTIFY_RIGHT: -- cgit v1.2.3 From 1c1d81211e14986917817b674c9c4230e84a304b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 25 Mar 2009 11:28:43 +0000 Subject: ** Fixes bug #576694 2009-03-25 Matthew Barnes ** Fixes bug #576694 * widgets/table/e-cell-text.c (build_layout): * widgets/text/e-text.c (reset_layout): Handle absolute font sizes correctly. svn path=/trunk/; revision=37474 --- widgets/table/e-cell-text.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'widgets/table/e-cell-text.c') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index a539e031eb..bb767c7bb0 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -593,16 +593,21 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) PangoFontDescription *desc = NULL, *fixed_desc = NULL; char *fixed_family = NULL; gint fixed_size = 0; + gboolean fixed_points = TRUE; fixed_desc = pango_font_description_from_string (ect->font_name); if (fixed_desc) { fixed_family = (char *)pango_font_description_get_family (fixed_desc); fixed_size = pango_font_description_get_size (fixed_desc); + fixed_points = !pango_font_description_get_size_is_absolute (fixed_desc); } desc = pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (((GnomeCanvasItem *)ecell_view->e_table_item_view)->canvas))->font_desc); pango_font_description_set_family (desc, fixed_family); - pango_font_description_set_size (desc, fixed_size); + if (fixed_points) + pango_font_description_set_size (desc, fixed_size); + else + pango_font_description_set_absolute_size (desc, fixed_size); /* pango_font_description_set_style (desc, PANGO_STYLE_OBLIQUE); */ pango_layout_set_font_description (layout, desc); pango_font_description_free (desc); -- cgit v1.2.3 From e42f27652709397453431b75c32601a4f4effd48 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 23 Apr 2009 10:02:07 -0400 Subject: =?UTF-8?q?Bug=20577929=20=E2=80=93=20Consolidate=20marshallers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consolidate all marshalling specifications to e-util/e-marshal.list. This reduces code duplication and makes it slightly easier to locate unused marshallers. --- widgets/table/e-cell-text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'widgets/table/e-cell-text.c') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index bb767c7bb0..15bd0504ec 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -1776,7 +1776,7 @@ e_cell_text_class_init (ECellTextClass *klass) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (ECellTextClass, text_inserted), NULL, NULL, - e_util_marshal_VOID__POINTER_INT_INT_INT_INT, + e_marshal_VOID__POINTER_INT_INT_INT_INT, G_TYPE_NONE, 5, G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); @@ -1787,7 +1787,7 @@ e_cell_text_class_init (ECellTextClass *klass) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (ECellTextClass, text_deleted), NULL, NULL, - e_util_marshal_VOID__POINTER_INT_INT_INT_INT, + e_marshal_VOID__POINTER_INT_INT_INT_INT, G_TYPE_NONE, 5, G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); -- cgit v1.2.3 From ce11d292c5487743d0543dd998cfd26b8afd0827 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 23 Apr 2009 14:20:11 -0400 Subject: =?UTF-8?q?Bug=20565780=20=E2=80=93=20Message=20view=20is=20tightl?= =?UTF-8?q?y=20packed=20and=20hard=20to=20read?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make ETables look more like GtkTreeViews by increasing the vertical padding to 4. If the users revolt, we can add a GtkStyle property to make the padding value adjustable via gtkrc files. --- widgets/table/e-cell-text.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'widgets/table/e-cell-text.c') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 15bd0504ec..25617ff4ff 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -61,6 +61,7 @@ #define d(x) #define DO_SELECTION 1 #define VIEW_TO_CELL(view) E_CELL_TEXT (((ECellView *)view)->ecell) +#define VERTICAL_PADDING 4 /* Padding for top and bottom */ #if d(!)0 #define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)), g_print ("%s: e_table_item_leave_edit\n", __FUNCTION__)) @@ -755,9 +756,9 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, gdk_gc_set_foreground (text_view->gc, foreground); x1 += 4; - y1 += 1; + y1 += VERTICAL_PADDING; x2 -= 4; - y2 -= 1; + y2 -= VERTICAL_PADDING; x_origin = x1 + ect->x + text_view->xofs - (edit ? edit->xofs_edit : 0); y_origin = y1 + ect->y + text_view->yofs - (edit ? edit->yofs_edit : 0); @@ -1154,7 +1155,7 @@ ect_height (ECellView *ecell_view, int model_col, int view_col, int row) layout = generate_layout (text_view, model_col, view_col, row, 0); pango_layout_get_pixel_size (layout, NULL, &height); g_object_unref (layout); - return height + 2; + return height + (VERTICAL_PADDING * 2); } /* -- cgit v1.2.3 From 6350c087b31b10d8d05b774e1829b3ff80812f90 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 23 Apr 2009 15:23:19 -0400 Subject: Reset ETable vertical padding to 3 to more closely match GtkTreeView. --- widgets/table/e-cell-text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'widgets/table/e-cell-text.c') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 25617ff4ff..e50d3d7ae7 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -61,7 +61,7 @@ #define d(x) #define DO_SELECTION 1 #define VIEW_TO_CELL(view) E_CELL_TEXT (((ECellView *)view)->ecell) -#define VERTICAL_PADDING 4 /* Padding for top and bottom */ +#define VERTICAL_PADDING 3 /* Padding for top and bottom */ #if d(!)0 #define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)), g_print ("%s: e_table_item_leave_edit\n", __FUNCTION__)) -- cgit v1.2.3