GNOME Bugzilla – Bug 672524
Use a spreadtable to improve the user experience
Last modified: 2021-06-19 08:57:41 UTC
We could definitely use a spreadtable or copy parts of it to improve the user experience. See the dnd test from libegg: http://git.gnome.org/browse/libegg/tree/libegg/spreadtable
Could you clarify that (advantages?), there is not class documentation on spreadtable and I don't have much idea what it does or could do for gdl. And in addition I doubt that this is an easy task.
I'd say try the widget, it is really handy. See also that I don't say to use it directly but to take the parts that we need to implement this behavior in gdl.
Read my comment as "I don't want to build libegg to try it", please!
heh, well the main difference is that you see the widget you hold and that the widgets are getting moved while you are dragging the one you have holded. It is a behavior very similar to the "gdl" from QT.
btw I do not say that it can be an easy task :) It could be even a nice thing for a GSoC
Some notes on spread table dnd... First of all, you are probably not interested in using spread table layouting itself for GDL, the spread table is an odd container widget which allocates children into columns of equal width while doing a binary search to attempt to keep each column height as small as possible (i.e. spread the widgets as evenly as possible across all columns, like paragraphs in a newspaper article). The Drag'n'Drop behavior therein (in the EggSpreadTableDnd subclass) requires some knowledge of the parent container widget and some cooperation with that widget. So basically, while a Drag'n'Drop is in effect, the parent container should no shuffle widgets around to satisfy request/allocation rules (you'll note some spread_table_lock() function which ensures this). The container widget should be able to animate widgets around during the drop... this is easy to do for instance for a Notebook widget, when targetting a notebook widget one can animate the tabs relatively easily in order to "highlight" the virtual drop target. It would also be relatively easy to do for a box widget, in essence to implement this for GDL you're going to need cooperation from all container widgets in use to do the animations. The grunt work of getting this done is indeed difficult, but EggSpreadTableDnd at least seems to get the Drag'n'Drop rules correctly (that was the most difficult part since Drag-n-Drop apis in GTK+ are not fun and not well documented). At least some study of how the EggSpreadTableDnd handles Drag'n'Drop of arbitrary widgets, as far as catching events and such should prove helpful... if one were to take on the task of doing this for GDL. Key note on that... event boxes and custom apis for adding/removing children was needed for this, because many arbitrary widgets preemptively handle events which are needed for drag'n'drop: This might not be needed if all children have a common container type, i.e. something with a "Grip" area explicitly usable for handling the drag/drop related events.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of gdl, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gdl/-/issues/ Thank you for your understanding and your help.