aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-browser.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2007-06-17 02:11:44 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-06-17 02:11:44 +0800
commit2c3588dfb263049299224e52a38f264369c84b7b (patch)
tree6d732344db5d4c31558495b3a0c5fbd5f09a1dc1 /mail/em-folder-browser.c
parent1a09e6737e6a74c8786042445bdf71882ef85bcb (diff)
downloadgsoc2013-evolution-2c3588dfb263049299224e52a38f264369c84b7b.tar.gz
gsoc2013-evolution-2c3588dfb263049299224e52a38f264369c84b7b.tar.zst
gsoc2013-evolution-2c3588dfb263049299224e52a38f264369c84b7b.zip
** Add support for the Magic Space Bar.
svn path=/trunk/; revision=33682
Diffstat (limited to 'mail/em-folder-browser.c')
-rw-r--r--mail/em-folder-browser.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index ab50741f8e..f560e150d6 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -412,6 +412,25 @@ emfb_realize (GtkWidget *widget)
}
static void
+html_scroll (GtkHTML *html,
+ GtkOrientation orientation,
+ GtkScrollType scroll_type,
+ gfloat position,
+ EMFolderBrowser *emfb)
+
+{
+ if (html->binding_handled || orientation != GTK_ORIENTATION_VERTICAL)
+ return;
+
+ if (scroll_type == GTK_SCROLL_PAGE_FORWARD) {
+ gtk_widget_grab_focus ((GtkWidget *)((EMFolderView *) emfb)->list);
+ message_list_select(((EMFolderView *) emfb)->list, MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN);
+ } else if (scroll_type == GTK_SCROLL_PAGE_BACKWARD) {
+ gtk_widget_grab_focus ((GtkWidget *)((EMFolderView *) emfb)->list);
+ message_list_select(((EMFolderView *) emfb)->list, MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN);
+ }
+}
+static void
emfb_init(GObject *o)
{
EMFolderBrowser *emfb = (EMFolderBrowser *)o;
@@ -423,6 +442,8 @@ emfb_init(GObject *o)
emfb->view.preview_active = TRUE;
emfb->view.list_active = TRUE;
+ g_signal_connect_after (((EMFormatHTML *)(emfb->view.preview))->html, "scroll", G_CALLBACK (html_scroll), emfb);
+
g_slist_foreach (emfb->view.ui_files, free_one_ui_file, NULL);
g_slist_free(emfb->view.ui_files);
@@ -1170,20 +1191,34 @@ emfb_search_search_cleared(ESearchBar *esb)
static int
emfb_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, EMFolderBrowser *emfb)
{
+ gboolean state, folder_choose = TRUE;
if ((ev->key.state & GDK_CONTROL_MASK) != 0)
return FALSE;
switch (ev->key.keyval) {
case GDK_space:
- em_utils_adjustment_page(gtk_scrolled_window_get_vadjustment((GtkScrolledWindow *)emfb->priv->scroll), TRUE);
+ state = gtk_html_command(((EMFormatHTML *)((EMFolderView *) emfb)->preview)->html, "scroll-forward");
+ if (!state)
+ folder_choose = message_list_select(((EMFolderView *) emfb)->list, MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN);
+
+ //em_utils_adjustment_page(gtk_scrolled_window_get_vadjustment((GtkScrolledWindow *)emfb->priv->scroll), TRUE);
break;
case GDK_BackSpace:
- em_utils_adjustment_page(gtk_scrolled_window_get_vadjustment((GtkScrolledWindow *)emfb->priv->scroll), FALSE);
+ state = gtk_html_command(((EMFormatHTML *)((EMFolderView *) emfb)->preview)->html, "scroll-backward");
+ if (!state)
+ folder_choose = message_list_select(((EMFolderView *) emfb)->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, CAMEL_MESSAGE_SEEN);
+
+ //em_utils_adjustment_page(gtk_scrolled_window_get_vadjustment((GtkScrolledWindow *)emfb->priv->scroll), FALSE);
break;
default:
return FALSE;
}
+ if (!folder_choose) {
+ EMFolderTree *emft = g_object_get_data((GObject*)emfb, "foldertree");
+ em_folder_tree_select_next_path (emft);
+ gtk_widget_grab_focus ((GtkWidget *)((EMFolderView *) emfb)->list);
+ }
return TRUE;
}