On 14/10/2015 04:40 πμ, SQville wrote:
> voger,
>
> I think it can be done. Instead of subclassing an entire widget try creating
> a Mixin to add a new themable property to your label.
>
> I created this Mixin for you to start from:
> https://github.com/sqville/sqv/blob/master/source/class/sqv/ui/basic/MLabel.js
>
> In your Application.js file add this line before you use it on a label.
> qx.Class.include(qx.ui.basic.Label, sqv.ui.basic.MLabel);
>
> Now all Labels that use qx.ui.basic.Label have a property called
> "rotatevertical" that you can set directly or set using an Appearance value
>
> Give it a try and let me know how it goes
>
> Chris

Sorry for the late reply. It took me a while to make it work. Here is 
what I did.

First I had to patch the decorator. In my Application.js :
         qx.Class.patch(qx.ui.decoration.Decorator, qssite.util.MLabel);

then in Decoration.js

           "test-decoration":{
                 style:{
                     rotatevertical: "270deg",
                 }
             }

and in Appearances.js


            "scallbar-page/button": {
                 include: "tabview-page/button",
                 style: function(states, style) {
                     var mceStyle = qx.lang.Object.clone(style);

                     mceStyle.padding = 0;
                     mceStyle.marginRight = -1;
                     mceStyle.marginLeft = 0;
                     mceStyle.marginTop = 1;
                     mceStyle.marginBottom = 1;
                     mceStyle.height = 150;
                     mceStyle.width = 30;

                     return mceStyle;
                 }
             },

            "scallbar-page/button/label": {
                 include: "tabview-page/button/label",
                 style: function(states, style) {
                     var mceStyle = qx.lang.Object.clone(style);
                     mceStyle.decorator = "test-decoration";
                     return mceStyle;
                 }
             },

"scallbar-page" is a custom name for the qx.ui.tabview.Page appearance 
property.

and when I create the page

     var label = page.getChildControl("button").getChildControl("label");
     label.setRich(true);
     label.getContentElement().setStyles({
           overflow: "visible",
           whiteSpace:"nowrap",
           textOverflow: "ellipsis"
     }, false);

Naturally now it has more work to be done.I have to calculate the proper 
translations etc. but it seems I am in a good path now. Thank you very 
much. Your class helped a lot.

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to