summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2018-03-25 12:52:10 +0200
committerNiels De Graef <nielsdegraef@gmail.com>2018-03-25 12:52:10 +0200
commit14a1b5f972963c85f4b68f13f5b6c543db87ec6b (patch)
tree524521e70b17decc0f1ec93ecacb7d6226a1b3b0
parentabd8f73708201f858b049385fb28702dd6c8db8e (diff)
downloadgnome-contacts-14a1b5f972963c85f4b68f13f5b6c543db87ec6b.tar.gz
ContactPane: add MaxWidthBin in the template.
-rw-r--r--data/ui/contacts-contact-pane.ui10
-rw-r--r--src/contacts-contact-pane.vala12
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) {