Skip to content

Commit 5bf166c

Browse files
committed
Material CheckBox Styles (Filled in), Material Radio Button Styles (With
GAP), Fixed Datagrid Responsiveness
1 parent a560ef8 commit 5bf166c

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

src/main/java/gwt/material/design/client/custom/MaterialCheckBoxCell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void render(Context context, Boolean value, SafeHtmlBuilder sb) {
118118

119119
String id = Document.get().createUniqueId();
120120

121-
sb.append(SafeHtmlUtils.fromSafeConstant("<span class=\"gwt-CheckBox\"><input type=\"checkbox\" tabindex=\"-1\" value=\"on\" id=\""
121+
sb.append(SafeHtmlUtils.fromSafeConstant("<span class=\"gwt-CheckBox\"><input type=\"checkbox\" class=\"filled-in\" tabindex=\"-1\" value=\"on\" id=\""
122122
+ id + "\" " + state + "/><label for=\"" + id + "\"></label></span>"));
123123

124124
}

src/main/java/gwt/material/design/client/ui/MaterialCheckBox.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.google.gwt.i18n.client.HasDirection.Direction;
3333
import com.google.gwt.i18n.shared.DirectionEstimator;
3434
import com.google.gwt.safehtml.shared.SafeHtml;
35+
import com.google.gwt.user.client.DOM;
3536
import com.google.gwt.user.client.ui.CheckBox;
3637

3738
public class MaterialCheckBox extends CheckBox implements HasClickHandlers{
@@ -137,10 +138,13 @@ public void setType(String type) {
137138
if(type.equalsIgnoreCase("indeterminate")){
138139
this.addStyleName(type + "-checkbox");
139140
}else if(type.equalsIgnoreCase("filled")){
140-
this.addStyleName(type + "-in");
141+
Element e_cb = this.getElement();
142+
Element e_input = DOM.getChild(e_cb, 0);
143+
e_input.setAttribute("class", "filled-in");
141144
}else{
142145
this.addStyleName(type);
143146
}
144147
}
148+
145149

146150
}

src/main/java/gwt/material/design/client/ui/MaterialRadioButton.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
* #L%
2121
*/
2222

23+
import com.google.gwt.dom.client.Element;
2324
import com.google.gwt.i18n.client.HasDirection.Direction;
2425
import com.google.gwt.i18n.shared.DirectionEstimator;
2526
import com.google.gwt.safehtml.shared.SafeHtml;
27+
import com.google.gwt.user.client.DOM;
2628
import com.google.gwt.user.client.ui.RadioButton;
2729

2830
public class MaterialRadioButton extends RadioButton{
@@ -80,7 +82,12 @@ public String getType() {
8082

8183
public void setType(String type) {
8284
this.type = type;
83-
this.addStyleName("with-" + type);
85+
if(type.equals("gap")){
86+
Element e_cb = this.getElement();
87+
Element e_input = DOM.getChild(e_cb, 0);
88+
e_input.setAttribute("class", "with-gap");
89+
}
90+
8491
}
8592

8693
public boolean isDisabled() {

src/main/resources/gwt/material/design/public/css/overridecss.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
color: rgba(0, 0, 0, 0.87);
1616
}
1717

18+
/** Calendar **/
19+
.picker__table td {
20+
padding: 0 !important;
21+
}
22+
1823

1924
/** DataGrid **/
2025
table th {
@@ -94,6 +99,7 @@ table .gwt-CheckBox label {
9499
top: 0 !important;
95100
left: 20% !important;
96101
width: 80% !important;
102+
height: 100% !important;
97103
}
98104

99105
}

0 commit comments

Comments
 (0)