From a161070ec2a2de0527a9b442f11d29a6749db122 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 2 Jun 2000 04:29:06 +0000 Subject: 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 --- mail/ChangeLog | 14 +++++++++++--- mail/folder-browser.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 7e8a5fe4d5..7e18f0094b 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,14 +1,22 @@ +2000-06-02 Dan Winship + + * folder-browser.c (my_folder_browser_init): Connect to ETable's + key_press signal. + (etable_key): scroll mail on space/backspace. + 2000-06-02 Christopher James Lahey * message-list.c: Made sent column as wide as from column. 2000-06-02 Jeffrey Stedfast - * mail-config.c (on_cmdSourcesAdd_clicked): Changed identity_row to source_row - as this is a Sources clist we are dealing with and not an identity clist + * mail-config.c (on_cmdSourcesAdd_clicked): Changed identity_row + to source_row as this is a Sources clist we are dealing with and + not an identity clist (on_cmdSourcesEdit_clicked): same (on_cmdSourcesDelete_clicked): again, same - (on_cmdSourcesEdit_clicked): Source editor now fills in data from the clist + (on_cmdSourcesEdit_clicked): Source editor now fills in data from + the clist 2000-06-01 Dan Winship 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); } -- cgit