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 322738 - Cell focus drawn incorrectly on ellipsized text cell renderers
Cell focus drawn incorrectly on ellipsized text cell renderers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.8.x
Other Linux
: Normal normal
: Small API
Assigned To: gtktreeview-bugs
gtktreeview-bugs
: 342301 344370 (view as bug list)
Depends on:
Blocks: 613728
 
 
Reported: 2005-11-29 09:41 UTC by Jorn Baayen
Modified: 2011-01-05 17:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of the problem (4.22 KB, application/octet-stream)
2005-11-29 09:42 UTC, Jorn Baayen
Details

Description Jorn Baayen 2005-11-29 09:41:39 UTC
The cell focus is drawn according to the cell size, and a text cell renderer
with ellipsis enabled will return a cell width of 3 characters.
Comment 1 Jorn Baayen 2005-11-29 09:42:19 UTC
Created attachment 55365 [details]
Screenshot of the problem
Comment 2 James "Doc" Livingston 2006-06-02 11:28:39 UTC
*** Bug 342301 has been marked as a duplicate of this bug. ***
Comment 3 Jonathan Matthew 2006-06-09 21:54:51 UTC
*** Bug 344370 has been marked as a duplicate of this bug. ***
Comment 4 Kristian Rietveld 2006-07-18 09:32:22 UTC
The get_size() method is really a problem here, since it can never return the actual width used when rendering.  The nicest way to fix this is probably adding another method to the GtkCellRenderer interface which would be almost the same as get_size(), but in this case also the background/cell areas are given.  This way the cell renderer text can correctly return the width of the layout used.

There are more things for which this might be useful:
  - Determining white areas in the tree view (think rubberbanding/DnD here)
  - If we are ever going to only draw a selection background under the cell (think Windows explorer), this might be useful too.
  - IIRC the inplace "tooltips" patch somewhere in bugzilla also adds a method like this.
Comment 5 Matthias Clasen 2006-07-18 22:39:26 UTC
That makes this 2.12 material then, I guess
Comment 6 Federico Mena Quintero 2010-03-23 18:59:16 UTC
Hmmm, is this still a problem?  I just saw an ellipsized text renderer and the focus is fine.  Maybe this is only a problem with individually-focusable cells?
Comment 7 Kristian Rietveld 2010-03-23 19:14:38 UTC
Yes this is still a problem and indeed only when the text renderer is individually focusable.
Comment 8 Tristan Van Berkom 2011-01-05 17:26:24 UTC
This is fixed in master by GtkCellArea 
(actually gtk_cell_renderer_get_aligned_area() fixes this particularly).