@mixin base-select($primaryStyleName : v-select) {
+$select-button-width : 1em;
+$select-button-negative-width : -1em;
+
.#{$primaryStyleName} {
text-align: left;
}
white-space: nowrap;
text-align: left;
display: inline-block;
+ padding-right: $select-button-width; /* Space for the button */
}
.v-filterselect .v-icon {
float: left;
.v-filterselect-button {
display: inline-block;
cursor: pointer;
- width: 1em;
+ width: $select-button-width;
+ margin-right: $select-button-negative-width;
height: 1em;
background: transparent url(../common/img/sprites.png) no-repeat -5px -8px;
}
@mixin chameleon-selects($primaryStyleName : v-filterselect) {
+$select-button-width : 16px;
+$select-button-negative-width : -16px;
+
.#{$primaryStyleName} {
overflow: hidden;
+ padding-right: $select-button-width; /* Space for the button */
}
&.v-app input.#{$primaryStyleName}-input {
}
.#{$primaryStyleName}-button {
- width: 16px;
+ width: $select-button-width;
+ margin-right: $select-button-negative-width;
height: 1.2em;
background-position: -5px -11px;
opacity: .4;
@mixin liferay-select {
+$select-button-width : 24px;
+$select-button-negative-width : -24px;
+
&.v-app select,
.v-window select {
padding: 1px;
select {
background-color: #fff;
}
-
+.v-filterselect {
+ padding-right: $select-button-width; /* Space for the button */
+}
.v-filterselect-button {
- width: 24px;
+ width: $select-button-width;
+ margin-right: $select-button-negative-width;
height: 24px;
background: transparent url(../common/buttons_sprites.png) no-repeat 0 0;
}
@mixin reindeer-select($primaryStyleName : v-filterselect) {
+$select-button-width : 25px;
+$select-button-negative-width : -25px;
+
.#{$primaryStyleName} {
height: 24px;
background-repeat: no-repeat;
background-image: url(img/left.png); /** sprite-ref: verticals; sprite-margin-bottom: 1px */
padding-left: 2px;
- padding-right: 25px; /* Space for the button */
+ padding-right: $select-button-width; /* Space for the button */
}
&.v-app .#{$primaryStyleName}-input,
.v-window .#{$primaryStyleName}-input,
}
.#{$primaryStyleName}-button {
overflow: hidden;
- width: 25px;
+ width: $select-button-width;
height: 24px;
background-position: 0 0;
background-image: url(img/right.png); /** sprite-ref: verticals ; sprite-margin-bottom: 1px */
cursor: default;
- margin-right: -25px;
+ margin-right: $select-button-negative-width;
}
.#{$primaryStyleName}-button:hover {
background-image: url(img/right-hover.png); /** sprite-ref: verticals */
@mixin runo-select($primaryStyleName : v-filterselect) {
+$select-button-width: 25px;
+$select-button-negative-width: -25px;
+
.v-select-select {
font-size: 13px;
}
height: 23px;
background: transparent url(img/bg-left-filter.png) no-repeat;
padding-left: 4px;
+ padding-right: $select-button-width; /* Space for the button */
}
&.v-app .#{$primaryStyleName} .#{$primaryStyleName}-input,
.v-window .#{$primaryStyleName} .#{$primaryStyleName}-input,
outline-offset: -4px;
}
.#{$primaryStyleName}-button {
- width: 25px;
+ width: $select-button-width;
+ margin-right: $select-button-negative-width;
height: 23px;
background: transparent url(img/bg-right-filter.png);
}
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
-import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.GridLayout;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.TwinColSelect;
import com.vaadin.ui.themes.ChameleonTheme;
-public class SelectsCssTest extends HorizontalLayout {
+public class SelectsCssTest extends GridLayout {
private TestSampler parent;
private int debugIdCounter = 0;
public SelectsCssTest(TestSampler parent) {
+ super(10, 1);
this.parent = parent;
setSpacing(true);
setWidth(null);
createDummyData(ns);
addComponent(ns);
- createComboBoxWith(null, null);
- createComboBoxWith("CB Search", ChameleonTheme.COMBOBOX_SEARCH);
+ createComboBoxWith(null, null, null);
+ createComboBoxWith("CB Search", ChameleonTheme.COMBOBOX_SEARCH, null);
createComboBoxWith("SelectButton",
- ChameleonTheme.COMBOBOX_SELECT_BUTTON);
+ ChameleonTheme.COMBOBOX_SELECT_BUTTON, null);
ListSelect ls = new ListSelect();
ls.setId("select" + debugIdCounter++);
createDummyData(ls);
addComponent(ls);
+
+ s = new Select("Basic select");
+ s.setId("select" + debugIdCounter++);
+ s.setWidth("100px");
+ addComponent(s);
+
+ s = new Select("Select with items");
+ s.setWidth("100px");
+ s.setId("select" + debugIdCounter++);
+ createDummyData(s);
+ addComponent(s);
+
+ createComboBoxWith(null, null, "100px");
+ createComboBoxWith("CB Search", ChameleonTheme.COMBOBOX_SEARCH, "100px");
+ createComboBoxWith("SelectButton",
+ ChameleonTheme.COMBOBOX_SELECT_BUTTON, "100px");
}
- private void createComboBoxWith(String caption, String primaryStyleName) {
+ private void createComboBoxWith(String caption, String primaryStyleName,
+ String width) {
ComboBox cb = new ComboBox();
cb.setId("select" + debugIdCounter++);
if (caption != null) {
if (primaryStyleName != null) {
cb.addStyleName(primaryStyleName);
}
+ if (width != null) {
+ cb.setWidth(width);
+ }
createDummyData(cb);
addComponent(cb);