aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-cell-text.c10
-rw-r--r--widgets/table/e-table-header-item.c31
-rw-r--r--widgets/table/e-table-item.c7
3 files changed, 38 insertions, 10 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 21133b1188..a8d2fa2a92 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -1328,6 +1328,16 @@ tooltip_event (GtkWidget *window,
}
}
+ event->button.x = tooltip->cx;
+ event->button.y = tooltip->cy;
+ gtk_signal_emit_by_name (GTK_OBJECT (tooltip->eti), "event",
+ event, &ret_val);
+ break;
+ case GDK_KEY_PRESS:
+ if (tooltip->window){
+ gtk_widget_destroy (tooltip->window);
+ tooltip->window = NULL;
+ }
gtk_signal_emit_by_name (GTK_OBJECT (tooltip->eti), "event",
event, &ret_val);
break;
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 9335c5fc89..c728baa747 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -780,6 +780,7 @@ draw_button (ETableHeaderItem *ethi, ETableCol *col,
0, 0);
} else {
int str_width, ellipsis_width, text_len;
+ int font_height, y_xtra;
text_len = strlen (col->text);
ellipsis_width = gdk_text_width (ethi->font, "...", 3);
@@ -787,6 +788,10 @@ draw_button (ETableHeaderItem *ethi, ETableCol *col,
str_width = gdk_text_width (ethi->font, col->text, text_len);
if (str_width < clip.width) {
+ font_height = gdk_text_height (ethi->font, col->text,
+ text_len);
+ y_xtra = (clip.height - font_height) / 2;
+
/* Center the thing */
xtra = (clip.width - gdk_string_measure (ethi->font, col->text))/2;
@@ -796,9 +801,8 @@ draw_button (ETableHeaderItem *ethi, ETableCol *col,
xtra += HEADER_PADDING / 2;
- gdk_draw_text (
- drawable, ethi->font,
- ethi->gc, x + xtra, y + ethi->height - ethi->font->descent - HEADER_PADDING / 2,
+ gdk_draw_text (drawable, ethi->font,
+ ethi->gc, clip.x + xtra, y + (ethi->height - y_xtra - HEADER_PADDING),
col->text, text_len);
} else {
/* Need ellipsis */
@@ -819,14 +823,18 @@ draw_button (ETableHeaderItem *ethi, ETableCol *col,
xtra += HEADER_PADDING / 2;
+ font_height = gdk_text_height (ethi->font, col->text,
+ ellipsis_length);
+ y_xtra = (clip.height - font_height) / 2;
+
gdk_draw_text (drawable, ethi->font, ethi->gc,
- x + xtra, y + ethi->height - ethi->font->descent - HEADER_PADDING / 2,
+ x + xtra, y + (ethi->height - y_xtra - HEADER_PADDING),
col->text, ellipsis_length);
gdk_draw_string (drawable, ethi->font, ethi->gc,
x + xtra + gdk_text_width (ethi->font,
col->text,
ellipsis_length),
- y + ethi->height - ethi->font->descent - HEADER_PADDING / 2,
+ y + (ethi->height - y_xtra - HEADER_PADDING),
"...");
}
}
@@ -1231,6 +1239,17 @@ ethi_popup_alignment(GtkWidget *widget, EthiHeaderInfo *info)
static void
ethi_popup_best_fit(GtkWidget *widget, EthiHeaderInfo *info)
{
+ ETableHeaderItem *ethi = info->ethi;
+ int width;
+
+ gtk_signal_emit_by_name (GTK_OBJECT (ethi->eth),
+ "request_width",
+ info->col, &width);
+ /* Add 10 to stop it from "..."ing */
+ e_table_header_set_size (ethi->eth, info->col, width + 10);
+
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi));
+
}
static void
@@ -1257,7 +1276,7 @@ static EPopupMenu ethi_context_menu [] = {
{ N_("Field Chooser"), NULL, GTK_SIGNAL_FUNC(ethi_popup_field_chooser), 0},
{ "", NULL, GTK_SIGNAL_FUNC(NULL), 1},
{ N_("Alignment"), NULL, GTK_SIGNAL_FUNC(ethi_popup_alignment), 1},
- { N_("Best Fit"), NULL, GTK_SIGNAL_FUNC(ethi_popup_best_fit), 1},
+ { N_("Best Fit"), NULL, GTK_SIGNAL_FUNC(ethi_popup_best_fit), 2},
{ N_("Format Columns..."), NULL, GTK_SIGNAL_FUNC(ethi_popup_format_columns), 1},
{ "", NULL, GTK_SIGNAL_FUNC(NULL), 1},
{ N_("Customize Current View..."), NULL, GTK_SIGNAL_FUNC(ethi_popup_customize_view), 1},
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 484b263aa1..0e329486b4 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1427,6 +1427,9 @@ _do_tooltip (ETableItem *eti)
int x = 0, y = 0;
int i;
+ if (eti_editing (eti))
+ return FALSE;
+
ecell_view = eti->cell_views[eti->tooltip->col];
for (i = 0; i < eti->tooltip->col; i++)
@@ -1465,10 +1468,6 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
gtk_timeout_remove (eti->tooltip->timer);
eti->tooltip->timer = 0;
}
- if (eti->tooltip->window) {
- gtk_widget_destroy (eti->tooltip->window);
- eti->tooltip->window = NULL;
- }
e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(eti));
switch (e->button.button) {