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

[Theming] Support customizing title pane buttons #444

Closed
kirill-grouchnikov opened this issue Feb 8, 2023 · 3 comments
Closed

[Theming] Support customizing title pane buttons #444

kirill-grouchnikov opened this issue Feb 8, 2023 · 3 comments
Assignees
Labels
7.0 - Karat Release 7.0 - 2024.H1

Comments

@kirill-grouchnikov
Copy link
Owner

Splitting off of 0a0c2e4#commitcomment-93364364

Add APIs to allow customizing the icons and the tooltips / texts used for title pane buttons:

  • Maximize
  • Restore
  • Iconify
  • Close

custom-titlepanebuttons1

custom-titlepanebuttons2

@kirill-grouchnikov kirill-grouchnikov added the 7.0 - Karat Release 7.0 - 2024.H1 label Feb 8, 2023
@kirill-grouchnikov kirill-grouchnikov self-assigned this Feb 8, 2023
kirill-grouchnikov added a commit that referenced this issue Feb 8, 2023
* `TitlePaneButtonProvider` interface for configuring the button icon and text (for tooltips and system menu)
* `TitlePaneButtonsProvider` for configuring maximize, restore, iconify and close buttons
* `DefaultTitlePaneButtonsProvider` with default implementations for the four buttons
* `RadianceThemingCortex.RootPaneScope.setTitlePaneButtonsProvider` to set a buttons provider on a specific root pane
* Wire the provider to the buttons in `RadianceTitlePane`, along with example code in the demo

This is for top-level root panes (in frames and dialogs). Second pass will provide support for `JInternalFrame`s.

For #444
@kirill-grouchnikov
Copy link
Owner Author

@ed-erwin-tf

@ed-erwin-tf
Copy link

ed-erwin-tf commented Feb 8, 2023

Thanks this could be useful to me.

I would want my icons to look similar to your defaults, so I've examined code in the "Blade" classes. Those are "internal", but it looks like they only use public apis, so I could probably replicate them.

By the way, I just found that BladeDrawingUtils.paintBladeSimpleBorder() does not dispose of the graphics object. (No point opening a bug for that.)

@kirill-grouchnikov
Copy link
Owner Author

Yes, the idea is definitely to not block app code. The internal flow there is mostly around getting the stroke width. I'll look at the disposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.0 - Karat Release 7.0 - 2024.H1
Projects
None yet
Development

No branches or pull requests

2 participants