[anjal] 2009-03-19 Priit Laes <plaes plaes org>



commit 61d08b2fd2948d3690d2f39d0784c23d82bf8813
Author: Priit Laes <plaes plaes org>
Date:   Thu Mar 19 12:55:30 2009 +0530

    2009-03-19 Priit Laes <plaes plaes org>
    
    	** src/mail-conv-view.c: Make Shift UP/Down to scroll in steps in
    	conversation view.
---
 ChangeLog            |    5 +++++
 src/mail-conv-view.c |   24 ++++++++++++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e9c706c..9e17511 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-19 Priit Laes <plaes plaes org>
+	
+	** src/mail-conv-view.c: Make Shift UP/Down to scroll in steps in
+	conversation view.
+
 2009-03-17  Srinivasa ragavan <sragavan novell com>
 	
 	** src/*/[ch]:  Make it themable and pick colors from theme
diff --git a/src/mail-conv-view.c b/src/mail-conv-view.c
index 483bee1..d7411a5 100644
--- a/src/mail-conv-view.c
+++ b/src/mail-conv-view.c
@@ -94,11 +94,31 @@ mcv_key_press (GtkWidget  *widget, GdkEventKey *event)
 		break;
 	case GDK_Down:
 	case GDK_KP_Down:
-		priv->selected_child = priv->selected_child->next ? priv->selected_child->next : priv->selected_child;
+		if (!(event->state & GDK_SHIFT_MASK)) {
+			priv->selected_child = priv->selected_child->next ?
+				priv->selected_child->next : priv->selected_child;
+		} else {
+			// Scroll by small steps
+			GtkAdjustment *adj = gtk_viewport_get_vadjustment (shell->priv->viewport);
+			gdouble step = gtk_adjustment_get_step_increment (adj);
+			gdouble new = gtk_adjustment_get_value (adj) + step;
+			gdouble max = gtk_adjustment_get_upper (adj);
+			gtk_adjustment_set_value (adj, new > max ? max : new);
+		}
 		break;
 	case GDK_Up:
 	case GDK_KP_Up:
-		priv->selected_child = priv->selected_child->prev ? priv->selected_child->prev : priv->selected_child;
+		if (!(event->state & GDK_SHIFT_MASK)) {
+			priv->selected_child = priv->selected_child->prev ?
+				priv->selected_child->prev : priv->selected_child;
+		} else {
+			// Scroll by small steps
+			GtkAdjustment *adj = gtk_viewport_get_vadjustment (shell->priv->viewport);
+			gdouble step = gtk_adjustment_get_step_increment (adj);
+			gdouble new = gtk_adjustment_get_value (adj) - step;
+			gdouble min = gtk_adjustment_get_lower (adj);
+			gtk_adjustment_set_value (adj, new < min ? min : new);
+		}
 		break;
 	case GDK_space:
 	case GDK_KP_Space:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]