Hi Jens! :)

I've tried to used addStyleName() to create a secondary style class for the 
lower tab bar but with my usual luck it isn't working... ofc ;)
All the labels use .gwt-TabBarItem as their stylesheet :(

*This are the following labels  in the java file:*
       * Label upLabel = new Label("this is a upper tab");*
*        /.../*
        *delistedLabel.addStyleDependentName("lowerTabBarItem");*
*        quotesLabel.addStyleDependentName("lowerTabBarItem");*
*
*
*And the following is in the style sheet:*
*.gwt-TabBarItem { background-color: green; }*
*.gwt-TabBarItem-lowerTabBarItem {!important; background-color: blue; }*

On Monday, July 8, 2013 4:58:37 PM UTC+2, Jens wrote:
>
> GWT has two kind of CSS classes: primary and dependent.
>
> By calling setStyleName() you have replaced all CSS classes on the 
> TabBarItem which your custom one. This makes your custom CSS class the new 
> primary CSS class. When selecting a TabBarItem the implementation calls 
> tabBarItem.setStyleDependentName("selected"). Now each TabBarItem contains 
> class="<primary-css-class> <primary-css-class>-selected" which means you 
> need upper/lowerTabBarItem-selected in your css file.
>
> Instead of setStyleName() you could use addStyleName() which does not 
> replace existing CSS classes and instead adds your custom class name to the 
> element. You maybe need "!important" in your CSS then to make sure no one 
> else overrides your CSS changes defined in your custom class name. That way 
> the primary CSS class name is still "gwt-TabBarItem" and thus 
> ".gwt-TabBarItem-selected" will work.
>
>
> -- J.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to