From 14a1b5f972963c85f4b68f13f5b6c543db87ec6b Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Sun, 25 Mar 2018 12:52:10 +0200 Subject: ContactPane: add MaxWidthBin in the template. --- data/ui/contacts-contact-pane.ui | 10 ++++++++++ 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 @@ none never automatic + + + True + 600 + + + contact-sheet-page 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) { -- cgit v1.2.1