Hi,

I have never done that before, but you could try and listen for 
"mouseover"/"mouseout" events and use addState("hovered") and 
removeState("hovered"), respectively, in order to toggle your widget's 
appearance.

Cheers,

   Norbert


Am 26.09.2015 um 16:05 schrieb voger:
> I have a widget that I want to decorate. But I can't find how to switch
> between states. Here is the code of the widget
>
> qx.Class.define("qssite.ui.popup.DesktopMessage", {
>       extend: qx.ui.popup.Popup,
>
>       properties: {
>           appearance: {
>               refine: true,
>               init: "desktop-notification-popup"
>           }
>
>       },
>
>       construct: function(layout) {
>           this.base(arguments, layout);
>
>       }
> });
>
> and here is the entry in my Decoration.js
>
>               "desktop-notification-popup": {
>                   style: {
>                       radius: 3,
>                       backgroundColor: "#272822"
>                   }
>               }
>
>
> and here is the entry in my Appearance.js
>
>               "desktop-notification-popup": {
>                   //alias:"popup",
>                   style: function(states) {
>                       console.log(states);
>                       var decorator = null;
>                       if (states.hovered) {
>                           decorator = "desktop-notification-popup";
>                       } else {
>                           decorator = undefined;
>                       }
>                       return {decorator:decorator};
>                   }
>
> This just displays the popup without any decoration and
> console.log(states); returns just an empty map. If I set the decorator
> without checking states then the widget is displayed decorated.
>
> How are the state set? In the docs I couldn't find anything useful. Just
> this
>
> States
> A state is used for every visual state a widget may have. Every state
> has flag character. It could only be enabled or
> disabled via the API addState or removeState.
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


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

Reply via email to