Project

General

Profile

Bug #5765

WDialog with percentage based initial size is not resizeable by user

Added by Marco Kinski about 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/14/2017
Due date:
% Done:

0%

Estimated time:

Description

When the user tries to resize a WDialog, with percentage based initial size, wt will automaticaly readjust the dialog size to the initial percentage based value (causing the dialog to flicker between the user and auto adjusting size). After the resize the dialog will get randomly the user specified or the restored (percentage based initial) size.

As a user i expect that when resizing the dialog the auto adjustment is getting turned off.

The following lines seem to fix that problem.

diff --git a/Wt/src/js/WDialog.js b/Wt/src/js/WDialog.js
--- a/Wt/src/js/WDialog.js
+++ b/Wt/src/js/WDialog.js
@@ -153,6 +153,8 @@ WT_DECLARE_WT_MEMBER
     * The dialog layout manager resizes the dialog
     */
    function layoutResize(ignored, w, h) {
+     if (resizeBusy) return; // prevents flickering while user changes size
+
      if (el.style.position == '') {
        el.style.position = WT.isIE6 ? 'absolute' : 'fixed';
      }
@@ -241,6 +243,11 @@ WT_DECLARE_WT_MEMBER
    this.onresize = function(w, h, done) {
      centerX = centerY = false;

+     if (!done) { // disable auto adjust
+        percentageHeight = -1;
+        percentageWidth = -1;
+     }
+
      resizeBusy = !done;
      wtResize(el, w, h);

No data to display

Also available in: Atom PDF