nautilus r14712 - in branches/gnome-2-24: . libnautilus-private



Author: alexl
Date: Thu Oct  9 10:31:14 2008
New Revision: 14712
URL: http://svn.gnome.org/viewvc/nautilus?rev=14712&view=rev

Log:
2008-10-09  Alexander Larsson  <alexl redhat com>

	Merged from trunk:

        * libnautilus-private/nautilus-horizontal-splitter.c:
        (nautilus_horizontal_splitter_button_press):
        (nautilus_horizontal_splitter_button_release):
	Don't toggle the splitter when dragging (#555619)
	Patch from Christoph Reiter



Modified:
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/libnautilus-private/nautilus-horizontal-splitter.c

Modified: branches/gnome-2-24/libnautilus-private/nautilus-horizontal-splitter.c
==============================================================================
--- branches/gnome-2-24/libnautilus-private/nautilus-horizontal-splitter.c	(original)
+++ branches/gnome-2-24/libnautilus-private/nautilus-horizontal-splitter.c	Thu Oct  9 10:31:14 2008
@@ -29,7 +29,6 @@
 #include <stdlib.h>
 
 struct NautilusHorizontalSplitterDetails {
-	double press_x;
 	guint32 press_time;
 	int press_position;
 	int saved_size;
@@ -37,7 +36,7 @@
 
 #define CLOSED_THRESHOLD 4
 #define NOMINAL_SIZE 148
-#define SPLITTER_CLICK_SLOP 1
+#define SPLITTER_CLICK_SLOP 4
 #define SPLITTER_CLICK_TIMEOUT	400
 
 static void nautilus_horizontal_splitter_class_init (NautilusHorizontalSplitterClass *horizontal_splitter_class);
@@ -193,7 +192,6 @@
 		(GTK_WIDGET_CLASS, button_press_event, (widget, event));
 
 	if (result) {
-		splitter->details->press_x = event->x;
 		splitter->details->press_time = event->time;
 		splitter->details->press_position = position;
 	}
@@ -207,14 +205,16 @@
 {
 	gboolean result;
 	NautilusHorizontalSplitter *splitter;
-	int delta, delta_time;
+	int position, delta, delta_time;
 	splitter = NAUTILUS_HORIZONTAL_SPLITTER (widget);
 
+	position = gtk_paned_get_position (GTK_PANED (widget));
+
 	result = EEL_CALL_PARENT_WITH_RETURN_VALUE
 		(GTK_WIDGET_CLASS, button_release_event, (widget, event));
 
 	if (result) {
-		delta = abs (event->x - splitter->details->press_x);
+		delta = abs (position - splitter->details->press_position);
 		delta_time = event->time - splitter->details->press_time;
 		if (delta < SPLITTER_CLICK_SLOP && delta_time < SPLITTER_CLICK_TIMEOUT)  {
 			nautilus_horizontal_splitter_toggle_position (splitter);



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