diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-06-27 05:09:11 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-06-27 05:09:11 +0800 |
commit | 99126d46e61ce19a72acb3dd8498729b025339ec (patch) | |
tree | d6875173b896e9a742a6207a5a1a6f2c2c7c56ec /modules/mail | |
parent | ce37d56d0b42f88549e45920df29a06fdce3ce95 (diff) | |
download | gsoc2013-evolution-99126d46e61ce19a72acb3dd8498729b025339ec.tar gsoc2013-evolution-99126d46e61ce19a72acb3dd8498729b025339ec.tar.gz gsoc2013-evolution-99126d46e61ce19a72acb3dd8498729b025339ec.tar.bz2 gsoc2013-evolution-99126d46e61ce19a72acb3dd8498729b025339ec.tar.lz gsoc2013-evolution-99126d46e61ce19a72acb3dd8498729b025339ec.tar.xz gsoc2013-evolution-99126d46e61ce19a72acb3dd8498729b025339ec.tar.zst gsoc2013-evolution-99126d46e61ce19a72acb3dd8498729b025339ec.zip |
Partial fix for bug #587014.
Cursor now moves to the correct row, but row is not selected.
Diffstat (limited to 'modules/mail')
-rw-r--r-- | modules/mail/e-mail-shell-view-private.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index f3b3b5a513..d410abb9c2 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -142,6 +142,54 @@ mail_shell_view_reader_status_message_cb (EMailShellView *mail_shell_view, } static void +mail_shell_view_scroll_cb (EMailShellView *mail_shell_view, + GtkOrientation orientation, + GtkScrollType scroll_type, + gfloat position, + GtkHTML *html) +{ + EShell *shell; + EShellView *shell_view; + EShellWindow *shell_window; + EShellSettings *shell_settings; + EMailReader *reader; + MessageList *message_list; + gboolean magic_spacebar; + + if (html->binding_handled) + return; + + if (orientation != GTK_ORIENTATION_VERTICAL) + return; + + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + shell = e_shell_window_get_shell (shell_window); + shell_settings = e_shell_get_shell_settings (shell); + + magic_spacebar = e_shell_settings_get_boolean ( + shell_settings, "mail-magic-spacebar"); + + if (!magic_spacebar) + return; + + reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); + message_list = e_mail_reader_get_message_list (reader); + + if (scroll_type == GTK_SCROLL_PAGE_FORWARD) { + gtk_widget_grab_focus (GTK_WIDGET (message_list)); + message_list_select ( + message_list, MESSAGE_LIST_SELECT_NEXT, + 0, CAMEL_MESSAGE_SEEN); + } else { + gtk_widget_grab_focus (GTK_WIDGET (message_list)); + message_list_select ( + message_list, MESSAGE_LIST_SELECT_PREVIOUS, + 0, CAMEL_MESSAGE_SEEN); + } +} + +static void mail_shell_view_load_view_collection (EShellViewClass *shell_view_class) { GalViewCollection *collection; @@ -317,6 +365,12 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) G_CALLBACK (mail_shell_view_key_press_event_cb), mail_shell_view); + g_signal_connect_data ( + html, "scroll", + G_CALLBACK (mail_shell_view_scroll_cb), + mail_shell_view, (GClosureNotify) NULL, + G_CONNECT_AFTER | G_CONNECT_SWAPPED); + g_signal_connect_swapped ( html, "status-message", G_CALLBACK (mail_shell_view_reader_status_message_cb), |