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

Transparent Icon Button / Slider ? #639

Closed
mokun opened this issue Aug 10, 2020 · 4 comments
Closed

Transparent Icon Button / Slider ? #639

mokun opened this issue Aug 10, 2020 · 4 comments
Assignees
Labels

Comments

@mokun
Copy link

mokun commented Aug 10, 2020

Hi,

How do I get rid of the pale pink background that comes with the WebButton ?

image

I'd like to create button that has a transparent background so that whatever icon image inside the button would appear to "float" on top of background panel.

Can it be done using weblaf and how ?

See below. I saw in the demo that there is a class called IconButton.

image

I guess the fourth row of button are NOT transparent. But at least, it appears so.

When I hover my mouse pointer over it, the pink background color shows up.

Without the mouse hovering over it, it doesn't show.

@mgarin
Copy link
Owner

mgarin commented Aug 10, 2020

You can use basic StyleId.buttonUndecorated style:

WebButton undecorated = new WebButton ( StyleId.buttonUndecorated );

You can provide that style in WebButton constructor or set it later at any point in runtime.

You can also apply style to JButton if you don't want any direct WebLaF dependencies:
https://github.com/mgarin/weblaf/wiki/How-to-style-Swing-components

P.S. It's not pink - it's light gray:

<GradientBackground>
    <color>white</color>
    <color>223,223,223</color>
</GradientBackground>

:)

@mgarin mgarin self-assigned this Aug 10, 2020
@mokun
Copy link
Author

mokun commented Aug 11, 2020


WebButton undecorated = new WebButton ( StyleId.buttonUndecorated );
..

The StyleId.buttonUndecorated work well. See below.

image

Question, is there a weblaf enhancement of the plain ol' JSlider in Swing ?

Any quick tips on replacing the color scheme, especially, making it transparent and floating, just like the WebButtton above ?

@mokun mokun changed the title Transparent Icon Button ? Transparent Icon Button / Slider ? Aug 11, 2020
@mgarin
Copy link
Owner

mgarin commented Aug 11, 2020

I haven't fully moved slider to new styling system, so it would be quite hard to change it looks right now. There are some settings you can modify in custom slider style coming from SliderPainter class, but those won't help in this particular case.

You can follow #493 to get updates on the slider changes once they go live.

@mgarin
Copy link
Owner

mgarin commented Aug 19, 2020

I'll close this question as it should now be answered.
Adjusting slider view will become possible once #493 is implemented (possibly in v1.2.15 update).

@mgarin mgarin closed this as completed Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants