Project

General

Profile

Bug #10722

WGridLayout does not calculate width or position correctly

Added by Andreas Frolov 14 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
08/04/2022
Due date:
% Done:

0%

Estimated time:

Description

I use the following example to illustrate the problem.

void showDialog()
{
    auto layout = std::make_unique<Wt::WGridLayout>();
    layout->addWidget(std::make_unique<Wt::WLabel>("Label"), 0, 0);
    layout->addWidget(std::make_unique<Wt::WLineEdit>(), 0, 1);

    auto dialog = std::make_unique<Wt::WDialog>("Dialog");
    dialog->contents()->setLayout(std::move(layout));
    dialog->exec();
}


Application::Application(const Wt::WEnvironment& env)
    : Wt::WApplication(env)
{
    Wt::WLayout::setDefaultImplementation(Wt::LayoutImplementation::JavaScript);
    setTheme(std::make_shared<Wt::WBootstrap5Theme>());

    showDialog();
}

Layout looks correct on the first monitor.

But not on the second monitor.

Even if I move the browser window between monitors, the layout is displayed correctly/incorrectly. Strange. My monitors have different resolutions. Maybe it's because.

If I disable JavaScript

//Wt::WLayout::setDefaultImplementation(Wt::LayoutImplementation::JavaScript);
setTheme(std::make_shared<Wt::WBootstrap5Theme>()); // optional on or off

it looks like this

Only the JavaScript variant with the default theme

Wt::WLayout::setDefaultImplementation(Wt::LayoutImplementation::JavaScript);
//setTheme(std::make_shared<Wt::WBootstrap5Theme>());

always looks correct


Files

clipboard-202208041401-4yrov.png (4.31 KB) clipboard-202208041401-4yrov.png Andreas Frolov, 08/04/2022 02:01 PM
clipboard-202208041406-jf9on.png (3.42 KB) clipboard-202208041406-jf9on.png Andreas Frolov, 08/04/2022 02:06 PM
clipboard-202208041412-isbvf.png (3.95 KB) clipboard-202208041412-isbvf.png Andreas Frolov, 08/04/2022 02:12 PM
clipboard-202208041434-vypfx.png (3.13 KB) clipboard-202208041434-vypfx.png Andreas Frolov, 08/04/2022 02:34 PM

No data to display

Also available in: Atom PDF