Grid - onMouseExit hover question [message #997912] |
Wed, 09 January 2013 01:18 |
|
I had a quick question about the behavior of the hovering logic of the grid component.
So I've implemented my own GridHeaderRenderer which provides a more Win7 native look and feel. It looks great and works great (almost). My renderer supports 3 different states (mouseover/hover,mousedown/selected,normal). Most of the logic I need is already supported out of the box by extending DefaultColumnHeaderRenderer. The one issue I'm having is detecting then the column header is hovered and the mouse exits the Grid directly from the column header (by moving up).
I believe I've tracked the issue down to one particular piece of logic which I wanted to question here before I open a bug request to make sure my understanding is correct. In the onHoverCell the Grid initializes the hoveringColumnHeader to a valid column (along with other fields). While in the onMouseExist those same hover fields are reset, with the exception of hoveringColumnHeader. Then, when the following logic in the paintHeader method is executed:
column.getHeaderRenderer().setHover(hoveringColumnHeader == column);
and the setHover for the renderer is set to true (in my use case).
So my question is
- Shouldn't hoveringColumnHeader be set to null in the onMouseExit method?
Again, I can open a bug report if changes are needed and even include a patch, if needed.
Additionally I can share the Header Renderer that I have implemented if interested (IIRC there was a request for more "Win7 native" headers here on the forums), while obviously not native it does give the a closer "win7" look.
Thanks for the nebula widgets!
|
|
|
Re: Grid - onMouseExit hover question [message #998175 is a reply to message #997912] |
Wed, 09 January 2013 13:59 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi Sven,
Your conclusion sounds correct. File a bug and attach a patch. If you'd
like to share your Win7-Rendering I'm more than happy to add them to the
Grid-Repository.
Just create a bug for them as well and attach the sources. I guess we'll
have to go through the IP-Process for them.
Tom
Am 09.01.13 14:25, schrieb Sean Ruff:
> I had a quick question about the behavior of the hovering logic of the
> grid component.
> So I've implemented my own GridHeaderRenderer which provides a more Win7
> native look and feel. It looks great and works great (almost). My
> renderer supports 3 different states
> (mouseover/hover,mousedown/selected,normal). Most of the logic I need
> is already supported out of the box by extending
> DefaultColumnHeaderRenderer. The one issue I'm having is detecting then
> the column header is hovered and the mouse exits the Grid directly from
> the column header (by moving up).
>
> I believe I've tracked the issue down to one particular piece of logic
> which I wanted to question here before I open a bug request to make sure
> my understanding is correct. In the onHoverCell the Grid initializes
> the hoveringColumnHeader to a valid column (along with other fields).
> While in the onMouseExist those same hover fields are reset, with the
> exception of hoveringColumnHeader. Then, when the following logic in
> the paintHeader method is executed:
>
> column.getHeaderRenderer().setHover(hoveringColumnHeader
> == column);
>
> and the setHover for the renderer is set to true (in my use case).
> So my question is
>
> Shouldn't hoveringColumnHeader be set to null in the onMouseExit method?
>
>
> Again, I can open a bug report if changes are needed and even include a
> patch, if needed.
> Additionally I can share the Header Renderer that I have implemented if
> interested (IIRC there was a request for more "Win7 native" headers here
> on the forums), while obviously not native it does give the a closer
> "win7" look.
>
>
> Thanks for the nebula widgets!
|
|
|
|
|
Re: Grid - onMouseExit hover question [message #1005522 is a reply to message #997912] |
Fri, 25 January 2013 23:45 |
|
Here's a patch with my updates for Win7 L&F support for Column headers.
I haven't found the time to include support for row headers, though it should be easy enough. While the patch supports Column groups it looks somewhat janky (to me) b/c I couldn't determine how they "should" be renderered in Win7. (Primarily how should the columns adjacent to a column group be renderered - since they have the same height as the group)
Anyway, posting here to see if anyone else finds this patch useful. If so I'll open a bug for possible inclusion with the grid widget.
For an example check out the GridSnippet10.java that is included in the patch or just:
Win7RendererSupport.create(grid).decorate();
Feedback welcome.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.27472 seconds