Shikhar13 / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

ComboBox (List) paints its items inside List's border. #259

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
code up a comboxbox. click on the combo to get the popup. make all styles 
padding 0 margin 0 for any components related in this story. make the list's 
border 1 pix thick. you'll see the items paint inside border.

I fixed it on my side by adding following in list's paint function:

if (style.getBorder() != null) {
   xTranslate += style.getBorder().getThickness();
}

Also see fix & problem in pic. Attached my theme (its my own custom format but 
its self explantory)

########################################;
# Combobox (<select> tag in  HTML)     #; 
########################################;
BozzaComboBox.padding=0,0,0,0;
BozzaComboBox.margin=0,0,0,0;
BozzaComboBox.font=0,8;
BozzaComboBox.border=coloredLine_1_C7ABD2;
BozzaComboBox.sel#derive=BozzaComboBox;
BozzaComboBox.sel#border=coloredLine_1_93278F;

BozzaComboBoxPopup.padding=0,0,0,0;
BozzaComboBoxPopup.margin=0,0,0,0;
BozzaComboBoxPopupTitle.derive=BozzaComboBoxPopup;

BozzaComboBoxPopupContentPane.padding=0,0,0,0;
BozzaComboBoxPopupContentPane.margin=0,0,0,0;
BozzaComboBoxPopupContentPane.border=coloredLine_1_93278F;
BozzaComboBoxPopupContentPane.sel#derive=BozzaComboBoxPopupContentPane;
BozzaComboBoxPopupContentPane.sel#border=coloredLine_1_93278F;

# This is the wrapper for the dropdown list of the combo;
BozzaComboBoxList.padding=0,0,0,0;
BozzaComboBoxList.margin=0,0,0,0;
BozzaComboBoxList.sel#derive=BozzaComboBoxList;
BozzaComboBoxList.sel#border=coloredLine_1_93278F;

# This is the items inside the dropdown list of the combo;
BozzaComboBoxItem.padding=0,0,0,0;
BozzaComboBoxItem.margin=0,0,0,0;
BozzaComboBoxItem.font=0,8;
BozzaComboBoxItem.sel#derive=BozzaComboBoxItem;

# This is the focused item inside the dropdown list of the combo;
BozzaComboBoxFocus.padding=0,0,0,0;
BozzaComboBoxFocus.margin=0,0,0,0;
BozzaComboBoxFocus.font=0,8;
BozzaComboBoxFocus.bgColor=93278F;
BozzaComboBoxFocus.sel#derive=BozzaComboBoxFocus; 

Original issue reported on code.google.com by jkoo...@gmail.com on 13 Jul 2012 at 9:39

Attachments:

GoogleCodeExporter commented 9 years ago
This is documented and by design. The padding should include border thickness.
Thickness is only relevant for line border so that obviously won't work.

Original comment by shai.almog on 13 Jul 2012 at 4:18