6 Replies Latest reply on Sep 11, 2009 2:48 PM by Ely Greenfield

    backgroundColor not working on halo controls

    KenichiM Level 1

      Using the latest nightly build - 4.0.0.10096.  The backgroundColor style (whether specified in a stylesheet or inline in the mxml) on a halo control such as VBox or Canvas does not take.  The compiler now adds a warning "The style 'backgroundColor' is only supported by the theme(s) 'halo'.".  Do I need to compile now with the halo theme?

        • 1. Re: backgroundColor not working on halo controls
          KenichiM Level 1

          There are other styles that aren't showing up anymore with the same warning The style 'XXXX' is only supported by the theme(s) 'halo'."  These styles include backgroundAlpha, borderSides, and borderThickness,

          • 2. Re: backgroundColor not working on halo controls
            rfrishbe Level 3

            I'll try to give some more background here.

             

            We have the MX component set (the old component set, like the old button, the old list, the old datagrid, etc...).  And we have the new Spark component set (the new component set with the new skinning architecture: the new button, the new list, the new dropdownlist, etc...).

             

            We also have sets of skins.  The Halo skin set is the old Flex 3 look and feel.  We have Halo skins for all of the MX component set to help people who have an existing application with an existing look and feel but want some of the new Flex 4 features, like two-way binding and TLF.  The Spark skin set is the new look and feel for the Spark component set and also a set of skins for the old MX components as well to give them a more consistent look and feel when combined with the new Spark components.

             

            Some MX components, like Canvas or MX:Application, end up having skins in both the Halo skin set and the Spark skin set.  The style metadata defined on Canvas tells the compiler which styles you can apply to a Canvas component.  The skin is usually the one who grabs this style information and acts upon it.  However, unfortunately, not all styles apply to all skins.  For example, the "backgroundGradientAlphas" style on MX:Application only applies to the Halo theme--the Spark theme ignores the style for this component entirely.  There's an unfortunate disconnect between the skin, who actually implements the style, and the component, who actually declares what styles are valid for this component.

             

            The way we're solving this usability issue for now is to add new information to the Style metadata, like:

             

            [Style(name="backgroundGradientAlphas", type="Array", arrayType="Number", inherit="no", theme="halo")]

             

            Which tells us that the backgroundGradientAlphas style only applies when the theme is Halo.  When the theme is Spark, this style is no longer applicable and a warning should be generated.

             

            We're in the process of adding this "warning feature."  I wouldn't really call last night's build, 4.0.0.10096, a particuarly stable and great one to try out.

             

            Also, there's some flux around "backgroundColor".  "backgroundColor" should actually apply in both the Halo and Spark theme set, and that's something we're working on fixing.

             

            Hope that explains the warnings.  For now, that feature is backed out while we work out some kinks.

             

            -Ryan

            1 person found this helpful
            • 3. Re: backgroundColor not working on halo controls
              KenichiM Level 1

              Thanks, I think I get it.  What is still unclear is if I wanted to use for example the borderSide style on a VBox, would I have to create a custom component derived off of VBox and define the style metadata for borderSide?  Or I will have to use the appropriate Spark component (Group, VGroup) and create and associate a skin?

              • 4. Re: backgroundColor not working on halo controls
                rfrishbe Level 3

                Sorry, I'm not sure what you mean.

                 

                The borderSides style is declared like:

                 

                [Style(name="borderSides", type="String", inherit="no", theme="halo")]

                 

                So if you're using the halo theme, you could set the borderSides style on a VBox.  If you're using the spark theme, you cannot set the borderSides style on a VBox.

                 

                The borderSides style is not defined on Group or VGroup.

                 

                -Ryan

                • 5. Re: backgroundColor not working on halo controls
                  KenichiM Level 1

                  So if I want to use borderStyle, I'll need to change the application theme to halo.  I noticed that when I do that, if I have any spark controls such as s:Label, it won't now pick up the correct fontFamily style.  I tried setting the fontFamily to a CFF and non-CFF font but it doesn't take.  If I use the halo theme, what other things associated with the Spark control will "break"?

                  • 6. Re: backgroundColor not working on halo controls
                    Ely Greenfield

                    The halo theme only works with mx components.  If you want to use 

                    spark, you'll need to use a spark compatible theme.

                     

                    Ely.