diff --git a/tryton/gui/window/view_form/view/calendar_.py b/tryton/gui/window/view_form/view/calendar_.py index 7b2e146c33..664209e497 100644 --- a/tryton/gui/window/view_form/view/calendar_.py +++ b/tryton/gui/window/view_form/view/calendar_.py @@ -41,13 +41,21 @@ class CalendarXMLViewParser(XMLViewParser): self.parse(child) goocalendar = Calendar_( self.view.attributes, self.view, self.calendar_fields) + scrolledwindow = Gtk.ScrolledWindow() + scrolledwindow.add(goocalendar) toolbar = Toolbar(goocalendar) - self.view.scroll.add(goocalendar) self.view.widget.pack_start( toolbar, expand=False, fill=False, padding=0) + self.view.widget.pack_start( + scrolledwindow, expand=True, fill=True, padding=0) self.view.widgets['goocalendar'] = goocalendar self.view.widgets['toolbar'] = toolbar + if attributes.get('height') or attributes.get('width'): + scrolledwindow.set_size_request( + int(attributes.get('width', -1)), + int(attributes.get('height', -1))) + def _parse_field(self, node, attributes): self.calendar_fields.append(attributes) @@ -64,10 +72,6 @@ class ViewCalendar(View): self.widgets = {} return - self.scroll = scrolledWindow = Gtk.ScrolledWindow() - self.widget.pack_end( - scrolledWindow, expand=True, fill=True, padding=0) - super().__init__(view_id, screen, xml) goocalendar = self.widgets['goocalendar']