Strange ToolBar Behaviour

Trying to customising the WebToolBar but keep discovering more and more oddities. Has someone experienced similar behaviour and might have a solution?

Most of the time it looks correct in the IDE but not in the browser. Sometimes, the flexible spaces is skipped entirely. Then the styles won’t applied properly for toggled buttons. In the example below, I use the same style for both a normal and a toggled button:


If it skips custom styles, you probably forgot the style for the button pressed/unpressed states.
If i remeber well, there should be a option for the button styles per action state or so.

I mean in the style editor.

[quote=219386:@Derk Jochems]If it skips custom styles, you probably forgot the style for the button pressed/unpressed states.
If i remeber well, there should be a option for the button styles per action state or so.

I mean in the style editor.[/quote]

This behaviour is experienced when nothing is pressed. I am talking about the “toggled” state, which can be assigned an entirely different style in the IDE (but is overwritten by the frameworks default style apparently)

Okay, it seems that the framework overwrites my custom style’s background with its “.toolbar .toggled” style definition which has higher CSS priority because it’s declared first.

Now figuring what hack is best to get around that.

  • hacking into the css style definitions using JS and “document.styleSheets”, adding “!Important” to custom style definitions > this is hardly documented and even less cross-browser compatible (sigh) but preferable.
  • remove the “toggled” class from the DOM element using JS. That’s way easier, but I don’t know if the framework relies on that class beyond styling

PS: I know it’s not supported to hack via JS, however I need to get around that bug quickly :slight_smile:

I found a way to enforce a style (in any context, essentially). It’s a simple drop-in class based on WebCustomControl, no JS hacking. However, I had to draw on further framework bugs to make it work (somewhat ironic, isn’t it?), which is the reason I am not making the class public. You can PM me to get a copy when you need it. I’ll report all the bugs encountered on my way shortly.