Bug #1937
closedHeight of WLineEdit elements inside WGridLayout too small using bootstrap theme
0%
Description
Hello,
when using WLineEdit elements inside a WGridLayout together with bootstrap theme, the height is too small by 10 pixels. This happens on all browsers except Internet Explorer. It seems to have to do with the style property "box-sizing: border-box", which is inserted by Wt for non-IE browsers.
Simple example code, where I can reproduce this behaviour:
...
Wt::WGridLayout *layout = new Wt::WGridLayout();
layout->addWidget(new Wt::WLineEdit(), 0, 0);
Wt::WContainerWidget *w = new Wt::WContainerWidget();
w->setLayout(layout);
...
Alexander
Files
Updated by Koen Deforche over 11 years ago
- Status changed from New to Rejected
- Assignee set to Koen Deforche
- Target version set to 3.3.0
Hey,
This is caused by Twitter Bootstrap's CSS which puts a margin of 10px below a line-edit.
The solution is to configure the container with a style class which switches this off:
setTheme(new Wt::WBootstrapTheme());
Wt::WGridLayout *layout = new Wt::WGridLayout();
layout->addWidget(new Wt::WLineEdit(), 0, 0);
Wt::WContainerWidget *w = new Wt::WContainerWidget();
w->addStyleClass("form-inline");
w->setLayout(layout);
w->decorationStyle().setBackgroundColor(yellow);
root()->addWidget(w);
Updated by Alexander Schnellberger over 11 years ago
- File wlineedit_inside_gridlayout_ie.png wlineedit_inside_gridlayout_ie.png added
- File wlineedit_inside_gridlayout_chrome.png wlineedit_inside_gridlayout_chrome.png added
Hi Koen,
I have tried what you suggested, but unfortunately without success (see screenshots).
Updated by Koen Deforche over 11 years ago
- Status changed from Rejected to Resolved
- Target version changed from 3.3.0 to 3.3.1
Hey,
Indeed, there was more to it than I first noticed... I'm committing a proper fix now.
Regards,
koen
Updated by Koen Deforche over 11 years ago
- Status changed from Resolved to Closed