aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text/e-completion-view.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-03-02 04:59:42 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-03-02 04:59:42 +0800
commitfae87e8d3d4e69f40b6c3e51ea2c8c8477995857 (patch)
tree3907c6a42f795558c43da5e081e7c2def2df5099 /widgets/text/e-completion-view.c
parent6f85f0645a53d9d3ea3621cdd9197e4e65cb90eb (diff)
downloadgsoc2013-evolution-fae87e8d3d4e69f40b6c3e51ea2c8c8477995857.tar
gsoc2013-evolution-fae87e8d3d4e69f40b6c3e51ea2c8c8477995857.tar.gz
gsoc2013-evolution-fae87e8d3d4e69f40b6c3e51ea2c8c8477995857.tar.bz2
gsoc2013-evolution-fae87e8d3d4e69f40b6c3e51ea2c8c8477995857.tar.lz
gsoc2013-evolution-fae87e8d3d4e69f40b6c3e51ea2c8c8477995857.tar.xz
gsoc2013-evolution-fae87e8d3d4e69f40b6c3e51ea2c8c8477995857.tar.zst
gsoc2013-evolution-fae87e8d3d4e69f40b6c3e51ea2c8c8477995857.zip
Boost version number to 0.5.99.3.
2001-03-01 Jon Trowbridge <trow@ximian.com> * configure.in: Boost version number to 0.5.99.3. * gal/e-text/e-entry.c (e_entry_show_popup): Grab pointer when the popup is visible, and then hide the popup if any button press events occur outside of the popup. This lets up avoid most of the worst "floating popup" cases that would occur if windows are moved, desktops changed, etc. with the mouse. (Doing things like changing desktop w/ keybindings can still cause a "floating popup", but that is also true of Gtk's own combo box.) Change popup positioning to slightly offset it from the entry, rather than just plopping it down directly below. (button_press_cb): Determine if a button press occured outside of the popup when the pointer was grabbed, and unbrowse accordingly. * gal/e-text/e-completion-view.c (e_completion_view_key_press_handler): Improve keystroke handling. Allow Tabs to pass through (after hiding the pop-up) in order to allow focus change requests to work properly. (e_completion_view_construct): Disable horizontal scrollbars. * gal/e-text/e-completion-test.c (main): Reworked to use signals instead of explicit callbacks. * gal/e-text/e-completion.h: * gal/e-text/e-completion.c: Fix the awkward mix of signals and explicitly-specified callbacks by taking out the explicit callbacks. This approach is more gtk-ish, after all. svn path=/trunk/; revision=8458
Diffstat (limited to 'widgets/text/e-completion-view.c')
-rw-r--r--widgets/text/e-completion-view.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/widgets/text/e-completion-view.c b/widgets/text/e-completion-view.c
index e2352ec7a9..825e7c5e11 100644
--- a/widgets/text/e-completion-view.c
+++ b/widgets/text/e-completion-view.c
@@ -305,6 +305,7 @@ e_completion_view_key_press_handler (GtkWidget *w, GdkEventKey *key_event, gpoin
{
ECompletionView *cv = E_COMPLETION_VIEW (user_data);
gint dir = 0;
+ gboolean key_handled = TRUE;
/* Start up a completion.*/
if (cv->complete_key && key_event->keyval == cv->complete_key && !cv->editable) {
@@ -332,13 +333,18 @@ e_completion_view_key_press_handler (GtkWidget *w, GdkEventKey *key_event, gpoin
case GDK_KP_Up:
dir = -1;
break;
+
+ case GDK_Tab:
+ /* Unbrowse, unhandled. */
+ cv->selection = -1;
+ dir = 0;
+ key_handled = FALSE;
+ break;
case GDK_Return:
case GDK_KP_Enter:
case GDK_space:
case GDK_KP_Space:
- case GDK_Right: /* Lynx-style "forward" */
- case GDK_KP_Right:
/* Only handle these key presses if we have an active selection;
otherwise, pass them on. */
if (cv->selection >= 0) {
@@ -353,17 +359,6 @@ e_completion_view_key_press_handler (GtkWidget *w, GdkEventKey *key_event, gpoin
dir = 0;
break;
- case GDK_Left: /* Lynx-style "back" */
- case GDK_KP_Left:
- if (cv->selection >= 0) {
- /* A hack to "unbrowse" us on these keys if we are browsing. */
- cv->selection = -1;
- dir = 0;
- break;
- }
-
- return FALSE;
-
default:
return FALSE;
}
@@ -385,13 +380,14 @@ e_completion_view_key_press_handler (GtkWidget *w, GdkEventKey *key_event, gpoin
gtk_signal_emit (GTK_OBJECT (cv), e_completion_view_signals[E_COMPLETION_VIEW_UNBROWSE]);
stop_emission:
- gtk_signal_emit_stop_by_name (GTK_OBJECT (w), "key_press_event");
+ if (key_handled)
+ gtk_signal_emit_stop_by_name (GTK_OBJECT (w), "key_press_event");
- return TRUE;
+ return key_handled;
}
static void
-begin_completion_cb (ECompletion *completion, gpointer user_data)
+begin_completion_cb (ECompletion *completion, const gchar *txt, gint pos, gint limit, gpointer user_data)
{
ECompletionView *cv = E_COMPLETION_VIEW (user_data);
@@ -405,7 +401,7 @@ static void
restart_completion_cb (ECompletion *completion, gpointer user_data)
{
/* For now, handle restarts like the beginning of a new completion. */
- begin_completion_cb (completion, user_data);
+ begin_completion_cb (completion, NULL, 0, 0, user_data);
}
static void
@@ -557,6 +553,8 @@ e_completion_view_construct (ECompletionView *cv, ECompletion *completion)
cv->table = e_table_scrolled_new (cv->model, NULL, simple_spec, NULL);
+ e_scroll_frame_set_policy (E_SCROLL_FRAME (cv->table), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+
frame = gtk_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (cv), frame);
@@ -655,6 +653,7 @@ e_completion_view_set_width (ECompletionView *cv, gint width)
e_table_group_compute_location (e_completion_view_table (cv)->group,
&dummy, &line_height, &r, &dummy);
}
+
if (line_height >= 1000) {
/* Something went wrong, so we make a (possibly very lame) guess */
line_height = 30;