changeset 0b8963092e77 in tryton:5.8
details: https://hg.tryton.org/tryton?cmd=changeset&node=0b8963092e77
description:
        Reshow wizard dialog with the initial size

        issue10648
        review363051003
        (grafted from 8fda9d49fb4e43f04f44ae219ee7ada8c4a53335)
diffstat:

 tryton/gui/window/wizard.py |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r 072cebe97529 -r 0b8963092e77 tryton/gui/window/wizard.py
--- a/tryton/gui/window/wizard.py       Tue Oct 26 19:40:49 2021 +0200
+++ b/tryton/gui/window/wizard.py       Sun Oct 31 10:14:37 2021 +0100
@@ -412,11 +412,15 @@
             width, height = self.default_size()
         else:
             width, height = -1, -1
-        self.dia.set_default_size(max(200, width), height)
-        width, height = self.dia.get_default_size()
-        if width > 0 and height > 0:
-            self.dia.resize(*self.dia.get_default_size())
+        self.dia.set_default_size(width, height)
+        # reshow with initial size
+        self.dia.hide()
+        self.dia.unrealize()
         self.dia.show()
+        width, height = self.dia.get_size()
+        screen = self.dia.get_screen()
+        self.dia.resize(
+            min(width, screen.width()), min(height, screen.height()))
 
     def hide(self):
         self.dia.hide()

Reply via email to