Skip to content

Commit 48d2698

Browse files
authored
Merge pull request #207 from GwtMaterialDesign/release_2.0
Follow up fixed for MaterialMenuBar issue.
2 parents d45bc6e + 1c19476 commit 48d2698

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/main/java/gwt/material/design/addins/client/menubar/MaterialMenuBar.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import gwt.material.design.client.MaterialDesignBase;
2626
import gwt.material.design.client.base.MaterialWidget;
2727

28+
import static gwt.material.design.jquery.client.api.JQuery.$;
29+
2830
//@formatter:off
2931

3032
/**
@@ -72,7 +74,21 @@ public class MaterialMenuBar extends MaterialWidget {
7274
}
7375
}
7476

77+
private String minHeight;
78+
7579
public MaterialMenuBar() {
7680
super(Document.get().createDivElement(), AddinsCssName.MENU_BAR);
7781
}
82+
83+
@Override
84+
protected void onLoad() {
85+
super.onLoad();
86+
$(getElement()).find(".dropdown-content li").css("minHeight", minHeight);
87+
$(getElement()).find(".dropdown-content li").css("lineHeight", minHeight);
88+
$(getElement()).find(".dropdown-content li").css("maxHeight", minHeight);
89+
}
90+
91+
public void setItemHeight(String minHeight) {
92+
this.minHeight = minHeight;
93+
}
7894
}

src/main/resources/gwt/material/design/addins/client/menubar/resources/css/menubar.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@
1111
top: -48px !important;
1212
}
1313
.menu-bar .dropdown-content li {
14+
display: inline-block;
1415
min-height: 0px;
1516
line-height: 0px;
16-
max-height: 32px !important;
17+
max-height: 32px;
18+
}
19+
.menu-bar li {
20+
height: 40px;
1721
}
1822
.menu-bar .dropdown-content li > a, .menu-bar .dropdown-content li > span {
1923
font-size: 12px !important;
2024
min-height: 0px;
2125
line-height: 16px;
2226
color: #000;
2327
padding: 8px 24px;
28+
display: inline-block;
2429
}
2530
/** Supports checkbox on dropdown **/
2631
.menu-bar ul.dropdown-content [type="checkbox"] + label{

0 commit comments

Comments
 (0)