开发者

how to set height of ComboBox in Vaadin

开发者 https://www.devze.com 2023-04-11 15:25 出处:网络
As noticed, the combobox\'s height in Vaadin is 24px by default.开发者_高级运维 Is there anyway to change the height? since setHeight(30, UNITS_PIXELS) doesn\'t work. the layout will be ruined.Java:

As noticed, the combobox's height in Vaadin is 24px by default.开发者_高级运维 Is there anyway to change the height? since setHeight(30, UNITS_PIXELS) doesn't work. the layout will be ruined.


Java:

comboBox.addStyleName("combobox-height-style");

CSS:

.v-filterselect-combobox-height-style {
    min-height: 30px;
}

.v-filterselect-combobox-height-style .v-filterselect-input {
    min-height: 30px;
}

.v-filterselect-combobox-height-style .v-filterselect-button {
    min-height: 28px;
}

The icon for the dropdown is a sprite and shouldn't be stretched, better to make a new resource image that is 30x30 pixels and use that as an icon. Eg:

.v-filterselect-combobox-height-style .v-filterselect-button {
    min-height: 28px;
    background: url("../img/dropdown_icon_30x30.png") no-repeat scroll transparent;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消