Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320661 - Label editor on connectors should be shorter
Summary: Label editor on connectors should be shorter
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.4.0   Edit
Hardware: PC Linux
: P3 normal
Target Milestone: 1.4.1   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-22 15:35 EDT by Anthony Hunter CLA
Modified: 2010-08-12 15:16 EDT (History)
1 user (show)

See Also:


Attachments
Patch to fix the issue. (2.29 KB, text/plain)
2010-07-22 15:36 EDT, Anthony Hunter CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Hunter CLA 2010-07-22 15:35:14 EDT
When creating a connector, direct label editor pops up. It is currently too long and can interfere with other actions. 

In addition, If you look at the text field, as soon as you type the first character "a", the text field shrinks back to the size of "a".

The issue is in TextDirectEditManager, 

if (label.getText().length() <= 0) {
            // if there is no text, let's assume a default size
            // because it looks silly when the cell editor it tiny.
            rect.setSize(new Dimension(text.computeSize(
                SWT.DEFAULT, SWT.DEFAULT)));
                            
Since we are passing in SWT.DEFAULT, computeSize returns an OS dependent value, which is big (64 pixels on linux). 

Rather than default to SWT.DEFAULT, we should default of the side of "a".
Comment 1 Anthony Hunter CLA 2010-07-22 15:36:11 EDT
Created attachment 175016 [details]
Patch to fix the issue.
Comment 2 Alex Boyko CLA 2010-07-22 15:42:39 EDT
Looks good to me.
Comment 3 Anthony Hunter CLA 2010-08-12 15:16:09 EDT
(In reply to comment #2)
> Looks good to me.

Thanks Alex, committed to HEAD and R1_4_maintenance for 1.4.1.