From 02f22d99c296dcfaa56c786e01de01e13eb38156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 26 Dec 2017 17:29:55 +0100 Subject: [PATCH] Use the same size for dialog as the sensible parent issue6997 review36881002 --- tryton/gui/window/preference.py | 2 +- tryton/gui/window/view_form/view/form_gtk/widget.py | 4 ++-- tryton/gui/window/win_csv.py | 3 +-- tryton/gui/window/win_form.py | 4 ++-- tryton/gui/window/win_search.py | 4 ++-- tryton/gui/window/wizard.py | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tryton/gui/window/preference.py b/tryton/gui/window/preference.py index 7b2acb6969..084119bbbc 100644 --- a/tryton/gui/window/preference.py +++ b/tryton/gui/window/preference.py @@ -75,7 +75,7 @@ class Preference(NoModal): self.win.set_title(_('Preference')) width, height = self.parent.get_size() - self.win.set_default_size(int(width * 0.9), int(height * 0.9)) + self.win.set_default_size(width, height) self.register() self.win.show() diff --git a/tryton/gui/window/view_form/view/form_gtk/widget.py b/tryton/gui/window/view_form/view/form_gtk/widget.py index ac48598ea3..91cc69f6ef 100644 --- a/tryton/gui/window/view_form/view/form_gtk/widget.py +++ b/tryton/gui/window/view_form/view/form_gtk/widget.py @@ -206,8 +206,8 @@ class TranslateDialog(NoModal): self.win.vbox.pack_start(scrolledwindow, True, True) sensible_allocation = self.sensible_widget.get_allocation() - self.win.set_default_size(int(sensible_allocation.width * 0.9), - int(sensible_allocation.height * 0.9)) + self.win.set_default_size( + sensible_allocation.width, sensible_allocation.height) self.register() self.win.show_all() diff --git a/tryton/gui/window/win_csv.py b/tryton/gui/window/win_csv.py index 4beaa1a944..a911b36fcf 100644 --- a/tryton/gui/window/win_csv.py +++ b/tryton/gui/window/win_csv.py @@ -209,8 +209,7 @@ class WinCSV(NoModal): sensible_allocation = self.sensible_widget.get_allocation() self.dialog.set_default_size( - int(sensible_allocation.width * 0.9), - int(sensible_allocation.height * 0.9)) + sensible_allocation.width, sensible_allocation.height) self.dialog.show_all() center_window(self.dialog, self.parent, self.sensible_widget) diff --git a/tryton/gui/window/win_form.py b/tryton/gui/window/win_form.py index a268d76872..c652aaf010 100644 --- a/tryton/gui/window/win_form.py +++ b/tryton/gui/window/win_form.py @@ -251,8 +251,8 @@ class WinForm(NoModal, InfoBar): self.win.vbox.pack_start(self.info_bar, False, True) sensible_allocation = self.sensible_widget.get_allocation() - self.win.set_default_size(int(sensible_allocation.width * 0.9), - int(sensible_allocation.height * 0.9)) + self.win.set_default_size( + sensible_allocation.width, sensible_allocation.height) if view_type == 'tree': self.screen.signal_connect(self, 'record-message', self._sig_label) diff --git a/tryton/gui/window/win_search.py b/tryton/gui/window/win_search.py index 1e69c55075..dbca3233a1 100644 --- a/tryton/gui/window/win_search.py +++ b/tryton/gui/window/win_search.py @@ -85,8 +85,8 @@ class WinSearch(NoModal): self.register() sensible_allocation = self.sensible_widget.get_allocation() - self.win.set_default_size(int(sensible_allocation.width * 0.9), - int(sensible_allocation.height * 0.9)) + self.win.set_default_size( + sensible_allocation.width, sensible_allocation.height) def sig_activate(self, *args): self.view.treeview.emit_stop_by_name('row_activated') diff --git a/tryton/gui/window/wizard.py b/tryton/gui/window/wizard.py index 66a77424e8..0c023e3828 100644 --- a/tryton/gui/window/wizard.py +++ b/tryton/gui/window/wizard.py @@ -336,8 +336,8 @@ class WizardDialog(Wizard, NoModal): # Dialog must be shown before the screen is displayed # to get the treeview realized when displayed sensible_allocation = self.sensible_widget.get_allocation() - self.dia.set_default_size(int(sensible_allocation.width * 0.9), - int(sensible_allocation.height * 0.9)) + self.dia.set_default_size( + sensible_allocation.width, sensible_allocation.height) self.dia.show() common.center_window(self.dia, self.parent, self.sensible_widget) super(WizardDialog, self).update(view, defaults, buttons)