Hello.  I am using a Custom Button Decorator.  I'm also using TypeScript (I'm
not good at JavaScript) but there should be great similarity.

    export function buttonDecorator(color: ColorType) {
        qx.Class.define("CustomButtonDecorator", {
            extend: qx.ui.decoration.Decorator,
            include: [
                qx.ui.decoration.MLinearBackgroundGradient,
                qx.ui.decoration.MBorderRadius
            ]
        });

        // 0099cc
        var c = Colors.getColor(color);
        var decorator = new CustomButtonDecorator().set({
            startColor: c,
            endColor: c,
            radius: 12
        });

        return decorator;
    }

Here are my color types:

    export enum ColorType {
        Primary, Success, Info, Warning, Danger, Pink, Gray, Blue
    }

    export class Colors {
        private static collection: string[] =
        ["#4b71e3", "#5ea457", "#50b1ff", "#ff8d00", "#f6546a", "#ff69b4",
"#999999", "#0000ff"];

        static getColor(type: ColorType): string {
            return Colors.collection[type];
        }
    }


To use it, I just call the function buttonDecorator:

        button.setDecorator(buttonDecorator(Colors.Primary));   // Blue
        button.setTextColor("white");




--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/UploadMgr-Progress-Status-Wow-tp7586852p7586904.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to