On Thu, 2010-04-22 at 18:33 +0100, Emmanuele Bassi wrote:

> wouldn't this be simply achieved by having a pseudo-class and calling:
> 
>   if (progress >= 0.5f)
>     mx_stylable_set_style_pseudo_class (progress_bar, "is-valid");
>   else
>     mx_stylable_set_style_pseudo_class (progress_bar, "not-valid");
> 
>   mx_progress_bar_set_progress (progress_bar, progress);
> 
> inside the application code? after all, if the app imposes a particular
> style on the progress bar then it should also be in charge of applying
> that particular style depending on its own semantics.


Yes, that's a good solution.

> 
> (though, I agree that having an API like:
> 
>   mx_progress_bar_set_style_ranges (progress_bar,
>                                     "pseudo-1", 0.0, 0.2,
>                                     "pseudo-2", 0.2, 0.5,
>                                     ...)
> 
> would be a fun addition to the class).

I was more thinking about application style overrides (much like
style="" in html elements). However, on second thoughts, that would
probably not be a good solution in this case. There is a third posible
way though, if we implemented CSS property matching. In this exapmle,
the resulting CSS would look something like:


MxProgressBarBar {
 backgorund-color: red;
}

MxProgressBarBar[value > 0.5] {
 backgorund-color: green;
}


Regards,

Thomas


---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
Moblin dev Mailing List
dev@moblin.org

To manage or unsubscribe from this mailing list visit:
http://lists.moblin.org/listinfo/dev or your user account on http://moblin.org 
once logged in.

For more information on the Moblin Developer Mailing lists visit:
http://moblin.org/community/mailing-lists

Reply via email to