Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 34159 - [Tasks] First three columns of Task List too wide w/native table
Summary: [Tasks] First three columns of Task List too wide w/native table
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P2 major (vote)
Target Milestone: 3.2 M2   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 58000 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-07 16:46 EST by Wilhelm Fitzpatricck CLA
Modified: 2005-08-24 17:32 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wilhelm Fitzpatricck CLA 2003-03-07 16:46:22 EST
The type, completion, and priority columns of the Task list using the native
table widget on MacOS X are much wider than are necessary for displaying the
icons in those columns and appear not to be resizable.
Comment 1 Veronika Irvine CLA 2003-03-07 17:14:46 EST
These values are hard coded in TaskList.

Note also that the native table does not yet support images in the column 
headers.  Need the same fix as for GTK.

Moving to Platform UI team.
Comment 2 Nick Edgar CLA 2003-03-11 16:11:38 EST
Veronika, the current code only sets the width to 19, so they should not be 
that wide.  I think there is an SWT or OS problem here too.
Comment 3 Chris McLaren CLA 2003-03-12 12:09:39 EST
i will make the change to the images in the table headers, but.. 

veronika: the mac seems to make these columns about 40 pixels wide at least, which 
doesn't have to do with the tasklist hardcoding anything, i don't think.
Comment 4 Nick Edgar CLA 2003-03-12 12:21:50 EST
McQ approves fix to change header to use text instead of icon on mac.
Comment 5 Veronika Irvine CLA 2003-03-12 12:47:11 EST
On the Mac, there is exta space in the header to the left and right of the 
text/image.  Currently it is using the width of the image + 25 pixels.  When 
you have text, it will be the width of the text + 25 pixels.  Without the + 25 
pixels, nothing will be displayed in the column header (or the text will be 
truncated with ...).  This is the native table behaviour.
Comment 6 Chris McLaren CLA 2003-03-13 11:11:30 EST
veronika: on mac apps this behavior doesn't seem to happen: imail, itunes, 
etc. all use the table with correct (i.e. 'small') column widths. how do we 
get that behavior?
Comment 7 Chris McLaren CLA 2003-03-13 17:02:52 EST
i have put the text back in the 2nd and 3rd column as requested. passing to 
SWT to get us table columns with widths like itunes, imail, etc.
Comment 8 Silenio Quarti CLA 2004-05-27 00:00:34 EDT
*** Bug 58000 has been marked as a duplicate of this bug. ***
Comment 9 Todd Brackett CLA 2005-04-15 13:17:51 EDT
Can we get a quick list of steps to reproduce the issue?  What SWT control is being leveraged here?  What 
is the underlying Carbon API?
Comment 10 Veronika Irvine CLA 2005-04-15 14:27:21 EDT
The widget is the DataBrowser.

Run the following example.

If you are running against 3.1 M6 (or earlier), you will see that the column is much wider than the 
image.

If you are running with the latest SWT from HEAD for 3.1, you will see that the column is as wide as the 
image but that the image is clipped and does not show the whole thing.
	
public static void main (String [] args) {
	Display display = new Display ();
	Shell shell = new Shell (display);
	Table table = new Table(shell, SWT.BORDER);
	TableColumn column = new TableColumn(table, SWT.NONE);
	TableItem item = new TableItem(table, SWT.NONE);
	Image image = display.getSystemImage(SWT.ICON_ERROR);
	item.setImage(image);
	Rectangle imageSize = image.getBounds();
	column.setWidth(imageSize.width);
	table.pack();
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}

There are few carbon API involved but the ones that stand out are:

SetDataBrowserTableViewNamedColumnWidth (parent.handle, id, (short) width);
Also in the SWT Table there is a drawItemProc where the image and text are being drawn.  This is 
installed on the DataBrowser using SetDataBrowserCustomCallbacks.
Comment 11 Veronika Irvine CLA 2005-04-15 14:28:18 EDT
The SWT widget is org.eclipse.swt.widgets.Table.
Comment 12 Todd Brackett CLA 2005-04-29 18:06:08 EDT
On Tiger and later, developers can use the DataBrowserSetMetric API to customize the amount of extra 
space Data Browser uses around cell content.
Comment 13 Silenio Quarti CLA 2005-08-24 13:07:13 EDT
Fixed > 20050824.

Only on Tiger.