diff options
-rw-r--r-- | data/ui/contacts-contact-pane.ui | 10 | ||||
-rw-r--r-- | src/contacts-contact-pane.vala | 12 |
2 files changed, 13 insertions, 9 deletions
diff --git a/data/ui/contacts-contact-pane.ui b/data/ui/contacts-contact-pane.ui index fe15c6c..d76e65e 100644 --- a/data/ui/contacts-contact-pane.ui +++ b/data/ui/contacts-contact-pane.ui @@ -50,6 +50,16 @@ <property name="shadow_type">none</property> <property name="hscrollbar_policy">never</property> <property name="vscrollbar_policy">automatic</property> + <child> + <object class="ContactsMaxWidthBin" id="contact_sheet_container"> + <property name="visible">True</property> + <property name="max-width">600</property> + </object> + </child> + <style> + <class name="contacts-main-view"/> + <class name="view"/> + </style> </object> <packing> <property name="name">contact-sheet-page</property> diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala index 1a21557..cf1d8aa 100644 --- a/src/contacts-contact-pane.vala +++ b/src/contacts-contact-pane.vala @@ -40,6 +40,8 @@ public class Contacts.ContactPane : Stack { [GtkChild] private ScrolledWindow contact_sheet_page; + [GtkChild] + private Container contact_sheet_container; private ContactSheet sheet; [GtkChild] @@ -197,17 +199,9 @@ public class Contacts.ContactPane : Stack { this.sheet.vexpand = true; this.sheet.margin = 36; this.sheet.set_margin_bottom (24); + this.contact_sheet_container.add (this.sheet); - var contact_sheet_container = new MaxWidthBin (); - contact_sheet_container.max_width = 600; - contact_sheet_container.show (); - contact_sheet_container.add (this.sheet); - - this.contact_sheet_page.add (contact_sheet_container); this.sheet.set_focus_vadjustment (this.contact_sheet_page.get_vadjustment ()); - - this.contact_sheet_page.get_child ().get_style_context ().add_class ("contacts-main-view"); - this.contact_sheet_page.get_child ().get_style_context ().add_class ("view"); } void on_add_detail (GLib.SimpleAction action, GLib.Variant? parameter) { |