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

Make the underline placement of tab-style toggle buttons configurable #529

Closed
Julien-Fischer opened this issue May 6, 2022 · 0 comments
Closed
Milestone

Comments

@Julien-Fischer
Copy link
Contributor

Julien-Fischer commented May 6, 2022

Feature

There is currently no client property allowing to configure the underline placement of a tab-style JToggleButton on a per-component basis.
For example, tabs placement in JTabbedPane can be set to top, left, bottom, or right.
Tab-style JToggleButton could therefore support the same underline placements.

In addition with being consistent with the JTabbedPane API, adding this feature to the tab-style toggle buttons would allow users to create task bars with any orientation (horizontal, vertical) and position (top, left, bottom, right) on screen.

Code example

// paint the button in tab style
toggleButton.putClientProperty( FlatClientProperties.BUTTON_TYPE, "tab" );
// paint the underline on the right side of the button (provided by this PR)
toggleButton.putClientProperty( FlatClientProperties.TAB_BUTTON_UNDERLINE_PLACEMENT, SwingConstants.RIGHT );

Compatibility

If not specified, the underline placement of tab-style toggle buttons is bottom so that this PR is compatible with previous releases. The bottom placement is also probably the most popular option for this component.

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

No branches or pull requests

2 participants