aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog7
-rw-r--r--widgets/e-text/Makefile.am13
-rw-r--r--widgets/e-text/e-text.c21
-rw-r--r--widgets/text/e-text.c21
4 files changed, 56 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 644b1f752a..b2625f1390 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
+
2000-02-29 NotZed <NotZed@HelixCode.com>
* tests/ui-tests/Makefile.am (filter_LDADD): Added test program.
diff --git a/widgets/e-text/Makefile.am b/widgets/e-text/Makefile.am
index ec7795f283..d0ee56e5e1 100644
--- a/widgets/e-text/Makefile.am
+++ b/widgets/e-text/Makefile.am
@@ -11,3 +11,16 @@ libetext_a_SOURCES = \
e-text-event-processor.h \
e-text-event-processor-emacs-like.c \
e-text-event-processor-emacs-like.h
+
+noinst_PROGRAMS = \
+ e-text-test
+
+e_text_test_SOURCES = \
+ e-text-test.c
+
+e_text_test_LDADD = \
+ libetext.a \
+ $(EXTRA_GNOME_LIBS) \
+ $(top_builddir)/e-util/libeutil.la
+
+e_text_test_LDFLAGS = `gnome-config --libs gdk_pixbuf`
diff --git a/widgets/e-text/e-text.c b/widgets/e-text/e-text.c
index 8bb19728c1..daa607007e 100644
--- a/widgets/e-text/e-text.c
+++ b/widgets/e-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);
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);