Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for hover on SplitPane divider #788

Merged
merged 3 commits into from Jan 10, 2024

Conversation

dar-dev
Copy link
Contributor

@dar-dev dar-dev commented Dec 29, 2023

It may be useful to have an hover on the SplitPane divider so the user can immediately spot the divider location.

To manage this feature we added a pair of new properties.

SplitPaneDivider.showHover	boolean	optional; default is false
SplitPaneDivider.hoverColor	Color	the divider color on mouse hover if SplitPaneDivider.showHover is enabled

For backwards compatibility this feature must be explicitly enabled.

Here's a simple demo:

splitpane_hover.mp4

Cheers,

Dar

--

dar-dev and others added 3 commits December 29, 2023 12:38
- removed `SplitPaneDivider.showHover` (hover is now enabled if hover color is specified)
- added `SplitPaneDivider.pressedColor` (for pressed/dragging in continuous layout)
- fixed painting of dragging divider in non-continuous layout (was 1px too small; added grip)
- updated styling unit tests
@DevCharly
Copy link
Collaborator

@dar-dev thanks for this PR 👍

I've reviewed it and made some changes:

  • removed SplitPaneDivider.showHover:
    To be consistent with other components, hover is now enabled if SplitPaneDivider.hoverColor is specified. Otherwise it is disabled (the default).
  • added SplitPaneDivider.pressedColor:
    Used for pressed/dragging state in continuous layout.
    In non-continuous layout, SplitPaneDivider.draggingColor is used as before.
  • Fixed painting of dragging divider in non-continuous layout, which was 1px too small and missed the grip dots.
  • Updated styling unit tests.

Please test whether it works for you. Thanks.

@MikOfClassX
Copy link

@DevCharly thanks for reviewing the code !

@dar-dev mods work flawlessly. just check them. For me is 👍.
In order to contribute it's important to stick to the FlatLaf philosophy as best as we can.
Thanks @DevCharly for pointing out.

@dar-dev
Copy link
Contributor Author

dar-dev commented Jan 9, 2024

Thanks for your review, it works perfectly.

--

@DevCharly DevCharly merged commit fa53e90 into JFormDesigner:main Jan 10, 2024
@DevCharly DevCharly added this to the 3.3 milestone Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants