After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 562405 - No gui way to reset a GtkPaned to auto mode
No gui way to reset a GtkPaned to auto mode
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-11-27 01:11 UTC by Morten Welinder
Modified: 2018-05-02 14:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Double click resets pane position (1.05 KB, patch)
2008-12-05 13:32 UTC, Christian Dywan
none Details | Review
Double click resets paned #2 (1.17 KB, patch)
2008-12-06 02:20 UTC, Christian Dywan
needs-work Details | Review

Description Morten Welinder 2008-11-27 01:11:29 UTC
Once the slider in a GtkPaned has been used, it cannot be returned to
"auto" mode.

Double-clicking seems like a nice way to perform that action.
This code (from Gnumeric) might be inspirational:

static gboolean
cb_paned_button_press (GtkWidget *widget, GdkEventButton *event)
{
	GtkPaned *paned = (GtkPaned *)widget;
	if (event->type == GDK_2BUTTON_PRESS && event->button == 1) {
		/* Cancel the drag that the first click started.  */
		GTK_WIDGET_GET_CLASS(paned)->button_release_event
			(widget, event);
		/* Then turn off set position that was set.  */
		gtk_paned_set_position (paned, -1);
		signal_paned_repartition (paned);
		return TRUE;
	}

	return FALSE;
}
Comment 1 Matthias Clasen 2008-11-27 01:59:59 UTC
Don't forget to add some keynav equivalent
Comment 2 Christian Dywan 2008-12-05 13:32:15 UTC
Created attachment 124001 [details] [review]
Double click resets pane position

This change implements the double click behaviour.

I have no idea how one would expect to do this with a keyboard, though.
Comment 3 Christian Dywan 2008-12-06 02:20:53 UTC
Created attachment 124041 [details] [review]
Double click resets paned #2

Corrected patch, the original one didn't check the gdk window and therefore caused double clicks in any child of the paned to reset the pane.
Comment 4 Matthias Clasen 2008-12-31 04:07:47 UTC
See bug 311733 for some discussion of double-clicking on small targets, and for an alternative proposal for what to use double-click on a paned handle for.
Comment 5 Daniel Boles 2017-10-16 14:13:57 UTC
Review of attachment 124041 [details] [review]:

This would presumably need done in a different way now that GtkPaned in GTK+ 3/4 uses gestures.

Also, I second that this would need a way to do the same thing by keyboard.

::: gtk/gtkpaned.c
@@ +1211,3 @@
   GtkPaned *paned = GTK_PANED (widget);
 
+  if (event->window != paned->handle || event->button != 1)

Aside from that, 1 should be changed to GDK_BUTTON_PRIMARY.
Comment 6 GNOME Infrastructure Team 2018-05-02 14:37:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/305.