Bug #1627

malfunctional WDialog::resize()

Added by Jan HrubeŇ° almost 8 years ago. Updated over 7 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:



I have some troubles with managing size of WDialog with contents() set to OverflowAuto.

I would like to set initial size, but resize, setWidth, setHeight doesn't work.

Setting max-size works fine.

Setting min-size works too, but I can't find these values in generated html (there are min-width: 0px; min-height:0px;).

<div style="position: fixed; z-index: 5; width: 600px; height: 600px; min-width: 0px; min-height: 0px; max-width: 600px; max-height: 600px; visibility: visible; left: 419px; margin-left: 0px; top: 10px; margin-top: 0px;" class="Wt-popup Wt-dialog Wt-outset Wt-resizable unselectable" unselectable="on" onselectstart="return false;" id="ogi5pw7">
        <!-- some spans and script was here -->
        <div style="max-width: 600px; max-height: 600px; width: 302px; height: 302px; min-width: 0px; min-height: 0px;" class="dialog-layout" id="ogi5pw9">
                <div style="position:relative;" id="ogi5pwb">
                        <!-- dialog title -->
                        <div style="overflow: auto; -moz-box-sizing: border-box; top: 21px; left: 0px; position: absolute; width: 600px; height: 579px;" class="body selectable" unselectable="off" onselectstart="event.cancelBubble=true; return true;" id="ogi5pwg">
                                <div id="ogi5pwj">Lorem ipsum ...</div>

Changing dialog size (it is resizable) with drag works fine with the size in given limits.

The problem is that initial size is dependent on content and max-width, max-height and ignores width and height attributes.

Test case is attached.

Tested with Wt 3.2.3.




dialogSizeTest.cpp (1.77 KB) dialogSizeTest.cpp test case Jan HrubeŇ°, 01/08/2013 09:51 AM

Updated by Koen Deforche over 7 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.3.0

Updated by Koen Deforche over 7 years ago

  • Status changed from InProgress to Resolved


Thanks for the test-case, I've fixed this in my git copy.

Btw. events can only be caught on the body/html, which in your test case is very small so that's why the resize event does not get delivered if you resize to quickly. We are reluctant to solve this in the library since that would have all kinds of unwanted side effets, and it usually only shows in a test case.

It can be fixed for example using :

    styleSheet().addRule("body, html",
                 "width: 100%; height: 100%;");




Updated by Koen Deforche over 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF