aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-06-02 12:29:06 +0800
committerDan Winship <danw@src.gnome.org>2000-06-02 12:29:06 +0800
commita161070ec2a2de0527a9b442f11d29a6749db122 (patch)
treeb06bd2b4fd723c9fd375450d27408b4a6c68a811 /mail/folder-browser.c
parent0dbb51b1475c924936803496aeeb2f3795804066 (diff)
downloadgsoc2013-evolution-a161070ec2a2de0527a9b442f11d29a6749db122.tar
gsoc2013-evolution-a161070ec2a2de0527a9b442f11d29a6749db122.tar.gz
gsoc2013-evolution-a161070ec2a2de0527a9b442f11d29a6749db122.tar.bz2
gsoc2013-evolution-a161070ec2a2de0527a9b442f11d29a6749db122.tar.lz
gsoc2013-evolution-a161070ec2a2de0527a9b442f11d29a6749db122.tar.xz
gsoc2013-evolution-a161070ec2a2de0527a9b442f11d29a6749db122.tar.zst
gsoc2013-evolution-a161070ec2a2de0527a9b442f11d29a6749db122.zip
Connect to ETable's key_press signal. (etable_key): scroll mail on
* folder-browser.c (my_folder_browser_init): Connect to ETable's key_press signal. (etable_key): scroll mail on space/backspace. svn path=/trunk/; revision=3375
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 426d163bd6..7b45afb989 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -349,6 +349,35 @@ search_activate(GtkEntry *entry, FolderBrowser *fb)
search_set(fb);
}
+static int
+etable_key (ETable *table, int row, int col, GdkEvent *ev, FolderBrowser *fb)
+{
+ if (ev->key.state != 0)
+ return FALSE;
+
+ if (ev->key.keyval == GDK_space || ev->key.keyval == GDK_BackSpace) {
+ GtkAdjustment *vadj;
+
+ vadj = e_scroll_frame_get_vadjustment (fb->mail_display->scroll);
+ if (ev->key.keyval == GDK_BackSpace) {
+ if (vadj->value > vadj->lower + vadj->page_size)
+ vadj->value -= vadj->page_size;
+ else
+ vadj->value = vadj->lower;
+ } else {
+ if (vadj->value < vadj->upper - 2 * vadj->page_size)
+ vadj->value += vadj->page_size;
+ else
+ vadj->value = vadj->upper - vadj->page_size;
+ }
+
+ gtk_adjustment_value_changed (vadj);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
folder_browser_gui_init (FolderBrowser *fb)
{
@@ -421,6 +450,9 @@ my_folder_browser_init (GtkObject *object)
fb->message_list = MESSAGE_LIST (message_list_new (fb));
fb->mail_display = MAIL_DISPLAY (mail_display_new (fb));
+ gtk_signal_connect (GTK_OBJECT (fb->message_list->etable),
+ "key_press", GTK_SIGNAL_FUNC (etable_key), fb);
+
folder_browser_properties_init (fb);
folder_browser_gui_init (fb);
}