aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-text.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2000-09-15 08:08:06 +0800
committerIain Holmes <iain@src.gnome.org>2000-09-15 08:08:06 +0800
commit22f72cc08e20c7871d93f05375fe2bafb0c1023a (patch)
treed765e7100abbfd00a916939716910b06e80e244c /widgets/table/e-cell-text.c
parent6d35f43ab255e79770f4be53c058a084fe9c6826 (diff)
downloadgsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.tar.gz
gsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.tar.zst
gsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.zip
Fix some crashes Make double clicking on the header dividers automatically
Fix some crashes Make double clicking on the header dividers automatically size the header to it's best fit. When dragging onto the header check the dragged item is a header object. Check the column is resizeable before setting the cursor to <-> Use the font and themes to draw the table and items. svn path=/trunk/; revision=5438
Diffstat (limited to 'widgets/table/e-cell-text.c')
-rw-r--r--widgets/table/e-cell-text.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index e78de94660..13008af8ad 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -460,6 +460,8 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
gboolean selected;
EFontStyle style;
+ EFontStyle style = E_FONT_PLAIN;
+
selected = flags & E_CELL_SELECTED;
if (edit){
@@ -1267,6 +1269,32 @@ ect_print_height (ECellView *ecell_view, GnomePrintContext *context,
return 16;
}
+static int
+ect_max_width (ECellView *ecell_view,
+ int model_col,
+ int view_col)
+{
+ /* New ECellText */
+ ECellTextView *text_view = (ECellTextView *) ecell_view;
+ EFont *font;
+ int row;
+ int number_of_rows;
+ int max_width = 0;
+
+ font = text_view->font;
+ number_of_rows = e_table_model_row_count (ecell_view->e_table_model);
+
+ for (row = 0; row < number_of_rows; row++) {
+ CurrentCell cell;
+ build_current_cell (&cell, text_view, model_col, view_col, row);
+ split_into_lines (&cell);
+ calc_line_widths (&cell);
+ max_width = MAX (max_width, cell.breaks->max_width);
+ }
+
+ return max_width;
+}
+
/*
* GtkObject::destroy method
*/
@@ -1357,6 +1385,7 @@ e_cell_text_class_init (GtkObjectClass *object_class)
ecc->leave_edit = ect_leave_edit;
ecc->print = ect_print;
ecc->print_height = ect_print_height;
+ ecc->max_width = ect_max_width;
object_class->get_arg = ect_get_arg;
object_class->set_arg = ect_set_arg;