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

Images on buttons #171

Closed
bvssvni opened this issue Nov 19, 2014 · 11 comments

Comments

@bvssvni bvssvni added the discussion label Nov 19, 2014

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented Nov 19, 2014

In Windows Forms (.NET) you could set both image and text and choose how to align the text.

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented Nov 19, 2014

Alternative is to create a separate button type for images.

@mitchmindtree

This comment has been minimized.

Copy link
Member

commented Nov 19, 2014

Yes this would be awesome :)

@gaudecker

This comment has been minimized.

Copy link
Contributor

commented Nov 19, 2014

On Android, There's an ImageButton for a widget that is just an image with button events. Besides that, there's a Button, which has a background defined by a theme/style, optional text and an optional icon, that you can align to left, right, top, or bottom like this:
Android Buttons

It might be the same functionality that @bvssvni said about Windows Forms, but I think it's very nice, since an icon with a label is pretty common usecase for a GUI.

@zummenix

This comment has been minimized.

Copy link
Contributor

commented Nov 20, 2014

On iOS, there is a method to set 'backgroundImage' – very convenient for buttons with custom design.

@yuripourre

This comment has been minimized.

Copy link
Contributor

commented Dec 7, 2014

In my opinion, Label could have different subtypes like: TextLabel, ImageLabel or CompositeLabel(Image+Text), because it's easier to code, using @gaudecker example:

Android Buttons

  • The first would be a Button with TextLabel;
  • The second would be a Button with an ImageLabel;
  • And the third would be a Button with a CompositeLabel;
@xilec

This comment has been minimized.

Copy link

commented May 8, 2015

In my opinion, it would be awesome realize something like WPF Content Model. I understand that it is too complicated solutions for topic task. But I saw attempts to realize Layouts in conrod and it would be greate using layouts to evade implementation of controls by hand which is just a combination of some basic controls (like Label, Button and Image for topic case).

@mitchmindtree

This comment has been minimized.

Copy link
Member

commented Feb 22, 2016

Just thought I'd mention that #696 adds a primitive Image widget which should make it easy to add image support (or variants) for various widgets.

@pierrechevalier83

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2016

I have been trying to tackle some rudimentary implementation of this feature:
#783

I don't understand why if I cover a part of the button with an image, though that part seems not to be clickable anymore. It is obvious when running the all_widgets example from my pull request and clicking the button that has a texture.

Does this behaviour make sense to anyone following this? Any tip?

@pierrechevalier83

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2016

For a quick update: I figured out what was missing. The image widget was capturing the mouse events that should have been captured by the button widget.

I know have the basic functionality working: a button with a texture. It doesn't handle positioning of the image within the button with respect to a label, though but it gives a starting point.

I also removed the part that modifies the button in the all_widgets example and wrote a dedicated button example to showcase the feature (heavily inspired from all_widgets).

This included modifying the git history, so I closed pull request #783 and opened #785.

I would welcome feedback, be it code review or suggestions for tackling more complex workflows (Like CompositeButton described in earlier comment)

pierrechevalier83 added a commit that referenced this issue Aug 15, 2016

@pierrechevalier83

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2016

Merged pull request for simple fix (add image method that takes image index)

mitchmindtree added a commit to mitchmindtree/conrod that referenced this issue Aug 16, 2016

Follow up to addition of image support in PistonDevelopers#171.
Move the image support along with related methods into their own type
parameter to try and properly distinguish behaviour at compile time.

Adds coloring options for Image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.