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 761838 - Editing widgets may be drawn off the visible area if the column is too narrow
Editing widgets may be drawn off the visible area if the column is too narrow
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks: 761374
 
 
Reported: 2016-02-10 18:35 UTC by Colomban Wendling
Modified: 2016-03-10 21:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample program showing the issue (894 bytes, text/plain)
2016-02-10 18:35 UTC, Colomban Wendling
  Details
treeview: Make sure the editing widget's top left is always visible (1.50 KB, patch)
2016-02-10 21:16 UTC, Colomban Wendling
committed Details | Review

Description Colomban Wendling 2016-02-10 18:35: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).
Comment 1 Colomban Wendling 2016-02-10 21:16:04 UTC
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.
Comment 2 Colomban Wendling 2016-02-10 21:27:42 UTC
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.
Comment 3 Matthias Clasen 2016-02-12 03:46:08 UTC
Attachment 320831 [details] pushed as a47d9a7 - treeview: Make sure the editing widget's top left is always visible
Comment 4 Colomban Wendling 2016-02-13 16:39:01 UTC
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?
Comment 5 Benjamin Otte (Company) 2016-02-14 14:03:08 UTC
Done.