aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text/e-text.c
diff options
context:
space:
mode:
authorIain Holmes <ih@csd.abdn.ac.uk>2000-03-01 05:43:45 +0800
committeriholmes <iholmes@localhost>2000-03-01 05:43:45 +0800
commit2fa1ed250656c38c4ad72525dd13a030de4bf061 (patch)
tree6f64e8f2fa7f7a59e06cee0e2050668ac0b17161 /widgets/text/e-text.c
parent832150b0dda320f18f1aedf2da23d0b087cde748 (diff)
downloadgsoc2013-evolution-2fa1ed250656c38c4ad72525dd13a030de4bf061.tar.gz
gsoc2013-evolution-2fa1ed250656c38c4ad72525dd13a030de4bf061.tar.zst
gsoc2013-evolution-2fa1ed250656c38c4ad72525dd13a030de4bf061.zip
Don't show the tooltip if the text is being editted or isn't clipped.
2000-02-29 Iain Holmes <ih@csd.abdn.ac.uk> * widgets/e-text/e-text.c: Don't show the tooltip if the text is being editted or isn't clipped. Remove the tooltip when editting starts. * widgets/e-text/Makefile.am: Build the test program svn path=/trunk/; revision=1994
Diffstat (limited to 'widgets/text/e-text.c')
-rw-r--r--widgets/text/e-text.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index 8bb19728c1..daa607007e 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -1830,8 +1830,14 @@ _do_tooltip (gpointer data)
gint x, y, pointer_x, pointer_y, scr_w, scr_h, tip_w, tip_h;
int i;
+ if (text->editing)
+ return FALSE;
+
lines = text->lines;
+ if (lines->length <= lines->ellipsis_length)
+ return FALSE;
+
scr_w = gdk_screen_width ();
scr_h = gdk_screen_height ();
gdk_window_get_pointer (NULL, &pointer_x, &pointer_y, NULL);
@@ -1938,6 +1944,14 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event)
break;
case GDK_BUTTON_PRESS: /* Fall Through */
case GDK_BUTTON_RELEASE:
+ text->tooltip_count --;
+ if ( text->tooltip_count == 0 && text->clip) {
+ gtk_timeout_remove (text->tooltip_timeout);
+ if (text->tooltip_window) {
+ gtk_widget_destroy (text->tooltip_window);
+ text->tooltip_window = NULL;
+ }
+ }
if ((!text->editing)
&& text->editable
&& event->type == GDK_BUTTON_RELEASE
@@ -1991,9 +2005,10 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event)
}
break;
case GDK_ENTER_NOTIFY:
- if ( text->tooltip_count == 0 )
+ if ( text->tooltip_count == 0 && text->clip) {
text->tooltip_timeout = gtk_timeout_add (1000, _do_tooltip, text);
- text->tooltip_count ++;
+ text->tooltip_count ++;
+ }
text->pointer_in = TRUE;
if (text->editing) {
if ( text->default_cursor_shown ) {
@@ -2004,7 +2019,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event)
break;
case GDK_LEAVE_NOTIFY:
text->tooltip_count --;
- if ( text->tooltip_count == 0 ) {
+ if ( text->tooltip_count == 0 && text->clip) {
gtk_timeout_remove (text->tooltip_timeout);
if (text->tooltip_window) {
gtk_widget_destroy (text->tooltip_window);