[med-svn] [SCM] aghermann branch, master, updated. 9c95ea59282c4fc6ef7eb192072500f9d0659fc3

Andrei Zavada johnhommer at gmail.com
Tue Jan 8 00:24:48 UTC 2013


The following commit has been merged in the master branch:
commit f5266721ce188d105ce92d3d9c119d0f638f879a
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Thu Jan 3 18:47:20 2013 +0200

    code in _cb must be very thin

diff --git a/src/ui/mw/mw-measurements.cc b/src/ui/mw/mw-measurements.cc
index fce997d..c5b64e4 100644
--- a/src/ui/mw/mw-measurements.cc
+++ b/src/ui/mw/mw-measurements.cc
@@ -280,4 +280,25 @@ draw_timeline( cairo_t *cr) const
 	}
 }
 
+
+void
+aghui::SExpDesignUI::
+modify_profile_scales( GdkScrollDirection d)
+{
+	switch ( d ) {
+	case GDK_SCROLL_DOWN:
+		profile_scale_psd /= 1.05;
+		profile_scale_swu /= 1.05;
+		profile_scale_mc  /= 1.05;
+	    break;
+	case GDK_SCROLL_UP:
+		profile_scale_psd *= 1.05;
+		profile_scale_swu *= 1.05;
+		profile_scale_mc  *= 1.05;
+	    break;
+	default:
+	    break;
+	}
+}
+
 // eof
diff --git a/src/ui/mw/mw-measurements_cb.cc b/src/ui/mw/mw-measurements_cb.cc
index 8c08f45..fa8d9ab 100644
--- a/src/ui/mw/mw-measurements_cb.cc
+++ b/src/ui/mw/mw-measurements_cb.cc
@@ -109,18 +109,7 @@ daSubjectTimeline_scroll_event_cb( GtkWidget *wid, GdkEventScroll *event, gpoint
 	auto& ED = J._p._p;
 
 	if ( event->state & GDK_CONTROL_MASK ) {
-		switch ( event->direction ) {
-		case GDK_SCROLL_DOWN:
-			ED.profile_scale_psd /= 1.05;
-			ED.profile_scale_mc /= 1.05;
-		    break;
-		case GDK_SCROLL_UP:
-			ED.profile_scale_psd *= 1.05;
-			ED.profile_scale_mc *= 1.05;
-		    break;
-		default:
-		    break;
-		}
+		ED.modify_profile_scales( event->direction);
 		gtk_widget_queue_draw( (GtkWidget*)ED.cMeasurements);
 		return TRUE;
 	} else
diff --git a/src/ui/mw/mw.hh b/src/ui/mw/mw.hh
index fb23961..5ade1c2 100644
--- a/src/ui/mw/mw.hh
+++ b/src/ui/mw/mw.hh
@@ -259,6 +259,8 @@ class SExpDesignUI
 		profile_scale_swu,
 		profile_scale_mc;
 	void calculate_profile_scale();
+	void modify_profile_scales( GdkScrollDirection);
+
 	bool	autoscale;
 	size_t	smooth_profile;
 

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list