royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piotr Zarzycki <piotrzarzyck...@gmail.com>
Subject Re: Thoughts on ToggleButton
Date Thu, 07 Dec 2017 10:51:46 GMT
Hi Harbs,

I would also place the logic which changes the image into the View bead. If
I correct understand your thoughts. I think if it is possible it would be
great reuse ImageButton in somehow, cause actually it is doing for one
state what you want.

It is the matter of handling states in the view.

Thanks, Piotr


2017-12-07 11:46 GMT+01:00 Harbs <harbs.lists@gmail.com>:

> I need a toggle button which displays images (i.e. ImageToggleButton).
>
> Right now, the way ImageButton works is that the main component modifies
> the element to show an image. This works only if you want a single image no
> matter what the state of the button is. If you want different images on
> hover, active, selected, etc. that requires a separate component.
> Additionally, I wanted a button in an app which uses images for states. I
> ended up just using a plain old div and setting the background image via
> css for the different states. Adding components for each and every use case
> seems broken.
>
> Ideally, with Royale architecture, the component should really be much
> more about the behavior of the component and the view should be delegated
> to a bead.
>
> I’m thinking that the logic which sets the html of the element should be a
> a view bead. Any thoughts about reworking this?
>
> Harbs




-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message