eclipse-emf / org.eclipse.emf

Eclipse Public License 2.0
10 stars 13 forks source link

Ecore and GenModel Editor Property table column too narrow #14

Closed Phillipus closed 10 months ago

Phillipus commented 10 months ago

Mac Ventura Eclipse 4.28

When editing an ecore file or genmodel file the property sheet's first column is too narrow so that the text is clipped. It would help if the column was resizeable, but it isn't.

Example 1

Screenshot 2023-10-01 at 06 38 52

Example 2

Screenshot 2023-10-01 at 06 39 11

Example 3

Screenshot 2023-10-01 at 06 40 45
merks commented 10 months ago

It works well (sized to fit the property labels) on Windows:

image

image

I recall a mac bug in the installer also related to auto-resizing of columns. The bug will be in org.eclipse.emf.common.ui.viewer.ColumnResizer, probably in org.eclipse.emf.common.ui.viewer.ColumnResizer.ColumnResizerHandler.controlResized(ControlEvent). The setup for contribution is very easy and automated:

https://github.com/eclipse-emf/org.eclipse.emf/blob/master/CONTRIBUTING.md

In fact, if you have the Platform SDK setup already, these source projects will already be in your workspace...

Phillipus commented 10 months ago

I had a look at ColumnResizer and I could see that there's a magic width offset of 10:

https://github.com/eclipse-emf/org.eclipse.emf/blob/fc18f373ecc2fa11c53f77fbc5b26f01cd03982b/plugins/org.eclipse.emf.common.ui/src/org/eclipse/emf/common/ui/viewer/ColumnResizer.java#L219

Changing the value to 28 works on Mac, but I don't know if there might be an underlying miscalculation from TreeColumn#getWidth()

Phillipus commented 10 months ago

The best I could come up with is:

int width = packedColumnWidths.get(i) + (SWT.getPlatform().equals("cocoa") ? 28 : 10);

But seems a bit of a workaround.

merks commented 10 months ago

It does seem like a bit of a workaround...

The 10 is just to add some padding on Windows so that it doesn't look like this:

image

From your pictures it does look like a certain fixed amount is cropped from the end, so a constant that looks fine for you is probably fine.

I'll go with that...

merks commented 10 months ago

A nightly build is in progress.

And thanks! 🥇

Phillipus commented 10 months ago

@merks Thanks for your commit!

merks commented 10 months ago

Effective teamwork makes for fast results! 💯