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

Underlined toggle buttons with per-instance properties #45

Closed
Chrriis opened this issue Jan 14, 2020 · 4 comments
Closed

Underlined toggle buttons with per-instance properties #45

Chrriis opened this issue Jan 14, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Chrriis
Copy link
Contributor

Chrriis commented Jan 14, 2020

Using toggle buttons that look like tabs is great for the L&F harmony of the application. This allows to create task bar buttons for example.

Now, depending on the context, the buttons will be adjusted in different ways (important bar may have bigger buttons, bold font, etc.). The problem is that the size of the underline and its related attributes are global. If I am not mistaken, there are no client properties to have a per-instance definition.

DevCharly added a commit that referenced this issue Jan 15, 2020
…ons with client properties `JToggleButton.tab.underlineHeight` (integer), `JToggleButton.tab.underlineColor` (Color) and `JToggleButton.tab.selectedBackground` (Color) (issue #45)
@DevCharly
Copy link
Collaborator

This is now implemented in master branch.

Use:

toggleButton.putClientProperty( FlatClientProperties.TAB_BUTTON_SELECTED_BACKGROUND, Color.green );
toggleButton.putClientProperty( FlatClientProperties.TAB_BUTTON_UNDERLINE_COLOR, Color.red );
toggleButton.putClientProperty( FlatClientProperties.TAB_BUTTON_UNDERLINE_HEIGHT, 5 );

@DevCharly
Copy link
Collaborator

Forgot to mention that I've renamed toggle button type "underline" to "tab". Value of client property JButton.buttonType is now tab. All UI defaults renamed from ToggleButton.underline.* to ToggleButton.tab.*.

@Chrriis
Copy link
Contributor Author

Chrriis commented Jan 15, 2020

Good! I wanted to suggest this change from "underline" to "tab" 🙂

@DevCharly DevCharly added the enhancement New feature or request label Jan 15, 2020
@DevCharly
Copy link
Collaborator

implemented in 0.26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants