There are a few aspects which are important to keep in mind:

* Using child control mechanisms always deactivates the manually applied
appeanrace of the widget and uses the child control ID instead. This is by
design as it simplifies a lot of cases where you don't have to find matching
appearance names yourself. Instead the "selector" used is somewhat magically
created by the system itself.
* Normally widgets containing child controls are styled at once e.g. a
Spinner, so the best you can do here, if you just want to override the style
of the up-button is to access the button of the spinner through the child
control ID e.g. "spinner/upbutton".
* Accessing private members like the properties user field is not good as
these internals things might change. Also there a values which have even a
higher priority than the user field or the value may be defined in the theme
or some other "field". The getter should always been used. But the getter
always return a value - even if no user value is configured (falls back to
the init value for example). Every widget in qooxdoo comes at least with a
default appearance normally configured by its init value.

The only issues which remains, if it is really an issue is, that you cannot
easily override a single instance which is managed by a child control. This
is rarely used so it might not be a problem for most users. You can
work-around this limitation adding states to the instance which needs a
customized look. This even allowes you to use the same properties as needed
from the default look e.g. just replace the background while keeping the
font for example. A lot easier than copy over the default style and create a
completely customized entry.

Hope this explains it a bit more. Until today I have never heard that
somebody has really a need for such a thing. But that does not mean a lot.
Do you already know about the state features? You may find some more
information regarding this topic in our wiki at:
http://qooxdoo.org/documentation/0.8/ui_appearance

Cheers,
Sebastian


2009/4/29 Matthew Gregory
<[email protected]<matthew%[email protected]>
>

> Thanks Sebastian,
>
> Regarding your comment on the bug, could you please explain the reason
> behind this? I understand the benefit of it working that way
> automatically, but not in preventing you from overriding it. The patch I
> uploaded uses the existing behaviour by default, but allows you to
> override the appearance if you want to.
>
> It doesn't make sence to me to not allow this. You can manually override
> other properties including the decorator.
>
> Thanks,
> Matt
>
>
> For the sake of the group this is the comment from the bug report:
> ------- Comment  #2 From Sebastian Werner  2009-04-29 12:27:11  [reply]
> -------
>
> Child controls are always styled according to the first parent which is
> not a child control of any other widget. Overriding a appearance of a
> child control is not possible - by design.
>
> But you can easily overwrite such a appearance entry by accessing the
> parent
> e.g.
>
> "button/label" : {
>   style : function()
>   {
>     return { textColor: "black" };
>   }
> }
>
> If you have further question regarding this topic feel free to post to our
> mailing list.
>
>
>
> Sebastian Werner wrote:
> > Mhh, maybe a state would help to customize a single instance in this
> case?!?
> >
> > Sebastian
> >
> >
> > 2009/4/29 Sebastian Werner <[email protected] <mailto:[email protected]
> >>
> >
> >     I would say it is a feature :)
> >
> >     Cheers,
> >     Sebastian
> >
> >
> >
> >
> >     2009/4/29 Matthew Gregory 
> > <[email protected]<matthew%[email protected]>
> >     <mailto:matthew%[email protected]<matthew%[email protected]>
> >>
> >
> >         Had a eurika moment :)
> >
> >         Reported as Bug#2324 with a proposed patch
> >
> >         Matthew Gregory wrote:
> >          > Hi All,
> >          > I seem to be having a problem with setAppearance. I have a
> >         standard
> >          > TabView with a button (tab) that I need to change the
> >         appearance of but
> >          > it doesn't work.
> >          >
> >          > page.getChildControl("button").setAppearance("button");
> >          >
> >          > This seems to be true for all child controls. I looked at
> >         syncAppearance
> >          > in Widget.js and it seems that the selector is correctly set.
> >          >
> >          > Is this a bug or a "feature"?
> >          >
> >          > TIA,
> >          > Matt
> >          >
> >          >
> >          >
> >
> ------------------------------------------------------------------------------
> >          > Register Now & Save for Velocity, the Web Performance &
> >         Operations
> >          > Conference from O'Reilly Media. Velocity features a full day
> of
> >          > expert-led, hands-on workshops and two days of sessions from
> >         industry
> >          > leaders in dedicated Performance & Operations tracks. Use
> >         code vel09scf
> >          > and Save an extra 15% before 5/3.
> >         http://p.sf.net/sfu/velocityconf
> >
> >
> >
> ------------------------------------------------------------------------------
> >         Register Now & Save for Velocity, the Web Performance &
> Operations
> >         Conference from O'Reilly Media. Velocity features a full day of
> >         expert-led, hands-on workshops and two days of sessions from
> >         industry
> >         leaders in dedicated Performance & Operations tracks. Use code
> >         vel09scf
> >         and Save an extra 15% before 5/3.
> http://p.sf.net/sfu/velocityconf
> >         _______________________________________________
> >         qooxdoo-devel mailing list
> >         [email protected]
> >         <mailto:[email protected]>
> >         https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> >
> ------------------------------------------------------------------------------
> > Register Now & Save for Velocity, the Web Performance & Operations
> > Conference from O'Reilly Media. Velocity features a full day of
> > expert-led, hands-on workshops and two days of sessions from industry
> > leaders in dedicated Performance & Operations tracks. Use code vel09scf
> > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > qooxdoo-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to