GNOME Bugzilla – Bug 761838
Editing widgets may be drawn off the visible area if the column is too narrow
Last modified: 2016-03-10 21:56:37 UTC
Created attachment 320821 [details] Sample program showing the issue Since this commit: > commit ceab99ff2ffcfd3f3e9644026ea9d4692cfbd11c > Author: Benjamin Otte <otte@redhat.com> > Date: Mon Jul 20 04:20:50 2015 +0200 > > treeview: Don't underallocate editing widgets that are too big editing widgets aren't underallocated, but are centered on their cell. This is a grave problem when the editing widget is on the first column and that first column is too narrow, because the left (start) of the editing widget is not visible as it overflows the TreeView's area. This leads to mostly unusable editing widgets in such a case. I'm not quite sure why underallocation was removed as the commit doesn't give further explanation, but at the very least the allocation should be kept inside the tree view's limits. Attached is a simple Python program showing the behavior: just try editing any of the first column's rows and see the left of the entry is invisible, giving no editing feedback. Breaks with 3.18 (and master), works fine with 3.16 and below (and 2.x).
Created attachment 320831 [details] [review] treeview: Make sure the editing widget's top left is always visible Proposed patch fixing the issue. It tries to push the editing widget back in the actually visible area (taking scrolling into account), and failing that (if the editing widget is too wide/tall), prefers the top left corner (so e.g. the start of a GtkEntry, where the data is likely to be, is visible). I'm not sure how well it would behave in RTL locales, and I suspect maybe the MIN/MAX combo should be swapped in such setups to prefer showing the end of the editing widget if we can't have both.
BTW, a more user friendly display could be to resize the column/row as needed during the editing, so the editing widget doesn't look out of place. Not sure if it's easily doable or has awful drawbacks, just a though because current situation looks a bit odd too.
Attachment 320831 [details] pushed as a47d9a7 - treeview: Make sure the editing widget's top left is always visible
Could this be added to the 3.18 branch also so it'd be part of 3.18.8, so all versions behave sanely in this regard?
Done.