Add width and height attributes on calendar view
issue9148 review250931003
This commit is contained in:
1 parent
2c0c89fb63
commit
935bf1df84
1 file changed
+9
-5
@@ -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']
|
||||
|
||||
Reference in new issue
Block a user