Project

General

Profile

Actions

Bug #1937

closed

Height of WLineEdit elements inside WGridLayout too small using bootstrap theme

Added by Anonymous over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
05/27/2013
Due date:
% Done:

0%

Estimated time:

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

wlineedit_inside_gridlayout_ie.png (24.8 KB) wlineedit_inside_gridlayout_ie.png Alexander Schnellberger, 05/31/2013 07:37 AM
wlineedit_inside_gridlayout_chrome.png (32.6 KB) wlineedit_inside_gridlayout_chrome.png Alexander Schnellberger, 05/31/2013 07:37 AM
Actions #1

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

Hi Koen,

I have tried what you suggested, but unfortunately without success (see screenshots).

Actions #3

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

Actions #4

Updated by Koen Deforche over 11 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF