Bug 154341 - Make table row height smaller.
Summary: Make table row height smaller.
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement with 9 votes (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 130031 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-18 07:15 EDT by alan crichton CLA
Modified: 2021-05-02 23:20 EDT (History)
13 users (show)

See Also:


Attachments
Helper class to work around bug 154341 (2.71 KB, text/x-java)
2012-09-05 10:30 EDT, Torsten Witte CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description alan crichton CLA 2006-08-18 07:15:37 EDT
I would like to be able to reduce the height of a table row.
(I wish to have wrapping text in a cell which is all displayed as the column width is changed). 
As far as I can see, this does not appear to be possible.

I noted the following comment on the newsgroups:

http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg29472.html
Comment 1 Grant Gayed CLA 2006-11-20 10:53:53 EST
*** Bug 130031 has been marked as a duplicate of this bug. ***
Comment 2 Chris Williams CLA 2010-02-22 17:51:33 EST
Just wanted to add my two cents: In Aptana Studio we've made keybindings to allow the user to increase/decrease font size and extended the theme's text editor font to also apply to a subclass of the Common Navigator (like Project Explorer). If a user bumps the font size up and then shrinks it the tree rows in the navigator remain at the larger size. I've added very hacky code to force the row height down in a measureitem listener on the tree, but the code really only applies to the cocoa SWT impl. I don't know if this bug is across all WS, but it looks like this was filed on Windows. In any case, it'd be nice to have an official API for "shrinking" an expanded row height for the tree.
Comment 3 Felipe Heidrich CLA 2010-02-24 12:13:56 EST
You should be able to shrink table item height by setting the font or by using custom draw.
Comment 4 Chris Williams CLA 2010-02-24 14:53:48 EST
Setting the font on the tree doesn't shrink it at all. Returning a smaller height for all rows via a MeasureItem listener doesn't either.

I'd prefer not to have to go down that low level to do custom drawing just to set the row height again.

I have platform specific code in reflection for mac and windows to handle this, but it's pretty ugly. When font size changes on windows I call setItemHeight on the tree through reflection. For Mac Cocoa I call setRowHeight on the view field on the Tree control via reflection.
Comment 5 Jared Menard CLA 2010-06-28 10:12:40 EDT
I just ran into this problem too. I have no idea how to work on a fix similar to the one Chris was talking about. Chris, any advice, direction, or code snippets? I do not care how messy the fix is, I am humble.
peace.
-jared
Comment 6 Torsten Witte CLA 2012-09-05 10:30:47 EDT
Created attachment 220735 [details]
Helper class to work around bug 154341

I've created a little helper class to work around this problem. It uses the way Chris Williams described above.
Comment 7 Torsten Witte CLA 2012-09-06 03:38:48 EDT
I've just seen that in bug report 148039 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=148039) a similar work around is added already.
Comment 8 Christoph Laeubrich CLA 2018-05-09 06:10:09 EDT
Are there any plans to fix this?