eclipse / nebula

Nebula Project
https://eclipse.org/nebula
Eclipse Public License 2.0
85 stars 98 forks source link

Grid cells not showing on Mac if setRowHeaderVisible(true) called before creating columns #573

Closed Phillipus closed 6 months ago

Phillipus commented 8 months ago

This is a problem again on Mac. See https://github.com/eclipse/nebula/pull/190

macOS 14.4 Sonoma Eclipse SWT 3.125.0.v20240227-1638

On Mac run GridViewerSnippet1

It looks like this:

Screenshot 2024-03-13 at 15 35 21

Now move this line to line 189 so it is called after creating the GridColumns:

https://github.com/eclipse/nebula/blob/7679ef64ea4378bdc66abf61f23705ddc083ee62/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippet1.java#L139

And it is OK:

Screenshot 2024-03-13 at 15 37 30
Phillipus commented 8 months ago

As an experiment, if I remove this line it works OK:

https://github.com/eclipse/nebula/blob/7679ef64ea4378bdc66abf61f23705ddc083ee62/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumn.java#L425

The condition is not met because parent.getClientArea().height is returning 0.

lcaron commented 8 months ago

Hello Phil

If you change the line 425 by this one is it better ?

if (IS_MAC && availableVisibleWidthForColumns == 1 && (parent.getClientArea().height == 1 || parent.getClientArea().height == 0))

(I think that the behaviour depends on the version of MacOs)

Phillipus commented 8 months ago

If you change the line 425 by this one is it better ?

Yes, because parent.getClientArea().height is returning 0.

(I think that the behaviour depends on the version of MacOs)

I think you may be right because this used to work, I think.

lcaron commented 6 months ago

Bug fixed in Nebula 3.2.0