Browse Source

replaced hard coded style with a css rule

svn changeset:15308/svn branch:6.4
tags/6.7.0.beta1
Matti Tahvonen 13 years ago
parent
commit
577c86186a

+ 4
- 0
WebContent/VAADIN/themes/base/button/button.css View File

/* /*
* Checkbox styles * Checkbox styles
* -------------------------------------- */ * -------------------------------------- */
.v-checkbox {
display: block;
}
.v-checkbox, .v-checkbox,
.v-checkbox label, .v-checkbox label,

+ 0
- 14
src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java View File



private Icon icon; private Icon icon;


private boolean isBlockMode = false;

private HandlerRegistration focusHandlerRegistration; private HandlerRegistration focusHandlerRegistration;
private HandlerRegistration blurHandlerRegistration; private HandlerRegistration blurHandlerRegistration;




@Override @Override
public void setWidth(String width) { public void setWidth(String width) {
setBlockMode();
super.setWidth(width); super.setWidth(width);
} }


@Override @Override
public void setHeight(String height) { public void setHeight(String height) {
setBlockMode();
super.setHeight(height); super.setHeight(height);
} }


/**
* makes container element (span) to be block element to enable sizing.
*/
private void setBlockMode() {
if (!isBlockMode) {
DOM.setStyleAttribute(getElement(), "display", "block");
isBlockMode = true;
}
}

public void onFocus(FocusEvent arg0) { public void onFocus(FocusEvent arg0) {
client.updateVariable(id, EventId.FOCUS, "", true); client.updateVariable(id, EventId.FOCUS, "", true);
} }

Loading…
Cancel
Save