summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-horizontal-splitter.c
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2000-06-23 23:19:48 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2000-06-23 23:19:48 +0000
commit6c7fee2b7a5c6947719760ce65862223ec338f75 (patch)
tree96ec538b5defde1619a3a818813be57481ad03ad /libnautilus-private/nautilus-horizontal-splitter.c
parente4ad959aaba17d803a7ee61e2a4b709400507da4 (diff)
downloadnautilus-6c7fee2b7a5c6947719760ce65862223ec338f75.tar.gz
fixed bug that Carbamide found where clicking in the list view titles
fixed bug that Carbamide found where clicking in the list view titles would toggle the sidebar. Fixed by requiring the click be in the splitter's window in order to toggle.
Diffstat (limited to 'libnautilus-private/nautilus-horizontal-splitter.c')
-rw-r--r--libnautilus-private/nautilus-horizontal-splitter.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/libnautilus-private/nautilus-horizontal-splitter.c b/libnautilus-private/nautilus-horizontal-splitter.c
index 512e3a39d..fa8015883 100644
--- a/libnautilus-private/nautilus-horizontal-splitter.c
+++ b/libnautilus-private/nautilus-horizontal-splitter.c
@@ -37,6 +37,7 @@ struct _NautilusHorizontalSplitterDetail
/* Bar width currently hardcoded to 7 */
#define BAR_WIDTH 7
#define CLOSED_THRESHOLD 4
+#define NOMINAL_SIZE 148
/* NautilusHorizontalSplitterClass methods */
static void nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class);
@@ -81,7 +82,7 @@ static void
nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter)
{
horizontal_splitter->details = g_new (NautilusHorizontalSplitterDetail, 1);
-
+ horizontal_splitter->details->saved_size = 0;
e_paned_set_handle_size (E_PANED (horizontal_splitter), BAR_WIDTH);
}
@@ -270,12 +271,13 @@ toggle_splitter_position(NautilusHorizontalSplitter *splitter)
int current_size;
gboolean grow_flag;
-
current_size = e_paned_get_position (E_PANED(splitter));
grow_flag = current_size < CLOSED_THRESHOLD;
if (!grow_flag)
splitter->details->saved_size = current_size;
-
+ else if (splitter->details->saved_size < CLOSED_THRESHOLD)
+ splitter->details->saved_size = NOMINAL_SIZE;
+
e_paned_set_position (E_PANED (splitter), grow_flag ? splitter->details->saved_size : 0);
}
@@ -306,15 +308,21 @@ static gboolean nautilus_horizontal_splitter_button_press (GtkWidget *widget,
static gboolean nautilus_horizontal_splitter_button_release (GtkWidget *widget, GdkEventButton *event)
{
NautilusHorizontalSplitter *splitter;
+ EPaned *paned;
int delta, delta_time;
splitter = NAUTILUS_HORIZONTAL_SPLITTER(widget);
- delta = abs (event->x - splitter->details->down_position);
- delta_time = abs (splitter->details->down_time - event->time);
- if (delta < 3 && delta_time < 2000) {
- toggle_splitter_position(splitter);
+
+ paned = E_PANED (widget);
+ if (event->window == paned->handle) {
+
+ delta = abs (event->x - splitter->details->down_position);
+ delta_time = abs (splitter->details->down_time - event->time);
+ if (delta < 3 && delta_time < 1500) {
+ toggle_splitter_position(splitter);
+ }
}
-
return NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, button_release_event, (widget, event));
+
}