summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Koivuviita <jouni.koivuviita@itmill.com>2009-11-08 21:24:47 +0000
committerJouni Koivuviita <jouni.koivuviita@itmill.com>2009-11-08 21:24:47 +0000
commit9a4eabaa7f8e3d5f9c497c940c577f02dfe88bcb (patch)
tree9b2301728e3c35d973b386f3a726e0933ccb3688
parent2b8e8c3f8f0853753fa904a53bb8e38a7aa5736a (diff)
downloadvaadin-framework-9a4eabaa7f8e3d5f9c497c940c577f02dfe88bcb.tar.gz
vaadin-framework-9a4eabaa7f8e3d5f9c497c940c577f02dfe88bcb.zip
* Fixes one regression from [9675] (undefined width MenuBar would fail to render)
* Fixes #3580: MenuBar stylenames aren't added to the submenu overlays svn changeset:9676/svn branch:6.2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java b/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java
index 22f35fe30f..1a9216c4c8 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java
@@ -69,12 +69,12 @@ public class VMenuBar extends Widget implements Paintable,
DOM.appendChild(table, tbody);
if (!subMenu) {
- setStyleName(CLASSNAME);
+ setStylePrimaryName(CLASSNAME);
Element tr = DOM.createTR();
DOM.appendChild(tbody, tr);
containerElement = tr;
} else {
- setStyleName(CLASSNAME + "-submenu");
+ setStylePrimaryName(CLASSNAME + "-submenu");
containerElement = tbody;
}
this.subMenu = subMenu;
@@ -107,6 +107,7 @@ public class VMenuBar extends Widget implements Paintable,
UIDL options = uidl.getChildUIDL(0);
+ // FIXME remove in version 7
if (options.hasAttribute("submenuIcon")) {
submenuIcon = client.translateVaadinUri(uidl.getChildUIDL(0)
.getStringAttribute("submenuIcon"));
@@ -192,6 +193,12 @@ public class VMenuBar extends Widget implements Paintable,
iteratorStack.push(itr);
itr = item.getChildIterator();
currentMenu = new VMenuBar(true);
+ if (uidl.hasAttribute("style")) {
+ for (String style : uidl.getStringAttribute("style").split(
+ " ")) {
+ currentMenu.addStyleDependentName(style);
+ }
+ }
currentItem.setSubMenu(currentMenu);
}
@@ -664,7 +671,8 @@ public class VMenuBar extends Widget implements Paintable,
// Only collapse if there is more than one item in the root menu and the
// menu has an explicit size
if ((getItems().size() > 1 || collapsedRootItems.getItems().size() > 0)
- && getElement().getStyle().getProperty("width") != null) {
+ && getElement().getStyle().getProperty("width") != null
+ && moreItem != null) {
// Measure the width of the "more" item
final boolean morePresent = getItems().contains(moreItem);