2011-11-07 [pawel] 3.7.10cvs77
authorPaweł Pękala <c0rn@gazeta.pl>
Mon, 7 Nov 2011 21:21:50 +0000 (21:21 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Mon, 7 Nov 2011 21:21:50 +0000 (21:21 +0000)
* src/mimeview.c
* src/textview.c
* src/textview.h
Make Home & End keys work in textview

ChangeLog
PATCHSETS
configure.ac
src/mimeview.c
src/textview.c
src/textview.h

index 008f5bc..3d43ddf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-07 [pawel]     3.7.10cvs77
+
+       * src/mimeview.c
+       * src/textview.c
+       * src/textview.h
+               Make Home & End keys work in textview
+
 2011-11-06 [colin]     3.7.10cvs76
 
        * src/mainwindow.c
index bd60c33..aeebfda 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.592 -r 1.382.2.593 src/compose.c;  ) > 3.7.10cvs74.patchset
 ( cvs diff -u -r 1.274.2.333 -r 1.274.2.334 src/mainwindow.c;  ) > 3.7.10cvs75.patchset
 ( cvs diff -u -r 1.274.2.334 -r 1.274.2.335 src/mainwindow.c;  ) > 3.7.10cvs76.patchset
+( cvs diff -u -r 1.83.2.178 -r 1.83.2.179 src/mimeview.c;  cvs diff -u -r 1.96.2.235 -r 1.96.2.236 src/textview.c;  cvs diff -u -r 1.12.2.27 -r 1.12.2.28 src/textview.h;  ) > 3.7.10cvs77.patchset
index a718c0f..32b498b 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=76
+EXTRA_VERSION=77
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 50e6bf3..f69e606 100644 (file)
@@ -473,7 +473,6 @@ void mimeview_show_message(MimeView *mimeview, MimeInfo *mimeinfo,
                           const gchar *file)
 {
        GtkCMCTree *ctree = GTK_CMCTREE(mimeview->ctree);
-       GtkCMCTreeNode *node;
 
        mimeview_clear(mimeview);
 
@@ -1444,6 +1443,11 @@ static gint mimeview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                return FALSE;
                
        switch (event->keyval) {
+       case GDK_KEY_Home:
+       case GDK_KEY_End:
+               textview_scroll_max(mimeview->textview,
+                                   (event->keyval == GDK_KEY_Home));
+               return TRUE;
        case GDK_KEY_Page_Down:
        case GDK_KEY_space:
                if (mimeview_scroll_page(mimeview,
index 3aa5feb..1e46886 100644 (file)
@@ -2262,6 +2262,23 @@ gboolean textview_scroll_page(TextView *textview, gboolean up)
        return gtkutils_scroll_page(GTK_WIDGET(text), vadj, up);
 }
 
+void textview_scroll_max(TextView *textview, gboolean up)
+{
+       GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview->text));
+       GtkTextIter iter;
+       
+       if (up) {
+               gtk_text_buffer_get_start_iter(buffer, &iter);
+               gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(textview->text),
+                                               &iter, 0.0, TRUE, 0.0, 1.0);
+       
+       } else {
+               gtk_text_buffer_get_end_iter(buffer, &iter);
+               gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(textview->text),
+                                               &iter, 0.0, TRUE, 0.0, 0.0);
+       }
+}
+
 #define KEY_PRESS_EVENT_STOP() \
        g_signal_stop_emission_by_name(G_OBJECT(widget), \
                                       "key_press_event");
@@ -2279,17 +2296,19 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
 
        switch (event->keyval) {
        case GDK_KEY_Tab:
-       case GDK_KEY_Home:
        case GDK_KEY_Left:
        case GDK_KEY_Up:
        case GDK_KEY_Right:
        case GDK_KEY_Down:
        case GDK_KEY_Page_Up:
        case GDK_KEY_Page_Down:
-       case GDK_KEY_End:
        case GDK_KEY_Control_L:
        case GDK_KEY_Control_R:
                return FALSE;
+       case GDK_KEY_Home:
+       case GDK_KEY_End:
+               textview_scroll_max(textview,(event->keyval == GDK_KEY_Home));
+               return TRUE;
        case GDK_KEY_space:
                if (summaryview)
                        summary_pass_key_press_event(summaryview, event);
index d157550..4d3432d 100644 (file)
@@ -108,6 +108,8 @@ void textview_scroll_one_line       (TextView       *textview,
                                 gboolean        up);
 gboolean textview_scroll_page  (TextView       *textview,
                                 gboolean        up);
+void textview_scroll_max       (TextView       *textview,
+                                gboolean        up);
 
 gboolean textview_search_string                        (TextView       *textview,
                                                 const gchar    *str,