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

Added VisImageButton constructor for images (up/down/checked) and stylename based buttons. #335

Merged
merged 2 commits into from
Aug 23, 2020
Merged

Conversation

lyze237
Copy link
Contributor

@lyze237 lyze237 commented Aug 20, 2020

As far as I understand the source code, it's currently not possible to create a VisImageButton which uses the "toggle" stylename (=> the blue background, without the "toggle" style it would have no blue background).

Therefore, I added a new constructor for the VisImageButton class which allows you to do that.

Example code:

table.add(new VisImageButton(upImage, downImage, checkedImage, "toggle"));

Example image ( Thanks @Travall ):

Untitled

Copy link
Owner

@kotcrab kotcrab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change VisImageButton (Drawable imageUp, Drawable imageDown, Drawable imageChecked) to use this new constructor (constructor chaining) to avoid code duplication. It should pass "default" style name to your new constructor.

@kotcrab
Copy link
Owner

kotcrab commented Aug 22, 2020

As far as I understand the source code, it's currently not possible to create a VisImageButton which uses the "toggle" stylename

I guess you could do that manually by obtaining the toggle Style from Skin and using VisImageButton (VisImageButtonStyle style) constructor

@lyze237 lyze237 requested a review from kotcrab August 23, 2020 10:19
@kotcrab kotcrab merged commit 911b281 into kotcrab:master Aug 23, 2020
@kotcrab
Copy link
Owner

kotcrab commented Aug 23, 2020

Thanks! I fixed formatting of the code (tabs vs spaces)

@lyze237 lyze237 deleted the visimagebuttonstyle branch August 23, 2020 11:32
fgnm pushed a commit to fgnm/vis-ui that referenced this pull request Aug 29, 2020
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.

2 participants