Change contact details dialog container to HdyClamp and enable label wrap (#948)
This commit is contained in:
parent
bf5f83c073
commit
ceaccdeefb
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<template class="DinoUiContactDetailsDialog">
|
<template class="DinoUiContactDetailsDialog">
|
||||||
|
<property name="default_width">800</property>
|
||||||
<property name="modal">True</property>
|
<property name="modal">True</property>
|
||||||
<child type="titlebar">
|
<child type="titlebar">
|
||||||
<object class="GtkHeaderBar">
|
<object class="GtkHeaderBar">
|
||||||
|
@ -20,6 +21,12 @@
|
||||||
<property name="hscrollbar_policy">never</property>
|
<property name="hscrollbar_policy">never</property>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="HdyClamp">
|
||||||
|
<property name="margin-right">18</property>
|
||||||
|
<property name="margin-left">18</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
|
@ -28,8 +35,6 @@
|
||||||
<object class="GtkGrid">
|
<object class="GtkGrid">
|
||||||
<property name="margin-top">20</property>
|
<property name="margin-top">20</property>
|
||||||
<property name="margin-bottom">12</property>
|
<property name="margin-bottom">12</property>
|
||||||
<property name="margin-right">100</property>
|
|
||||||
<property name="margin-left">100</property>
|
|
||||||
<property name="column-spacing">10</property>
|
<property name="column-spacing">10</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<child>
|
<child>
|
||||||
|
@ -99,8 +104,8 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="width">1</property>
|
<property name="width">1</property>
|
||||||
<property name="height">1</property>
|
<property name="height">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
|
@ -110,8 +115,6 @@
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="main_box">
|
<object class="GtkBox" id="main_box">
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="margin-right">100</property>
|
|
||||||
<property name="margin-left">100</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
@ -121,5 +124,7 @@
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</template>
|
</template>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
|
@ -85,11 +85,11 @@ public class Dialog : Gtk.Dialog {
|
||||||
ListBoxRow list_row = new ListBoxRow() { activatable=false, visible=true };
|
ListBoxRow list_row = new ListBoxRow() { activatable=false, visible=true };
|
||||||
Box row = new Box(Orientation.HORIZONTAL, 20) { margin_start=15, margin_end=15, margin_top=3, margin_bottom=3, visible=true };
|
Box row = new Box(Orientation.HORIZONTAL, 20) { margin_start=15, margin_end=15, margin_top=3, margin_bottom=3, visible=true };
|
||||||
list_row.add(row);
|
list_row.add(row);
|
||||||
Label label_label = new Label(label) { xalign=0, yalign=0.5f, hexpand=true, visible=true };
|
Label label_label = new Label(label) { xalign=0, yalign=0.5f, hexpand=true, wrap=true, visible=true };
|
||||||
if (description != null && description != "") {
|
if (description != null && description != "") {
|
||||||
Box box = new Box(Orientation.VERTICAL, 0) { visible=true };
|
Box box = new Box(Orientation.VERTICAL, 0) { visible=true };
|
||||||
box.add(label_label);
|
box.add(label_label);
|
||||||
Label desc_label = new Label("") { xalign=0, yalign=0.5f, hexpand=true, visible=true };
|
Label desc_label = new Label("") { xalign=0, yalign=0.5f, hexpand=true, wrap=true, visible=true };
|
||||||
desc_label.set_markup("<span size='small'>%s</span>".printf(Markup.escape_text(description)));
|
desc_label.set_markup("<span size='small'>%s</span>".printf(Markup.escape_text(description)));
|
||||||
desc_label.get_style_context().add_class("dim-label");
|
desc_label.get_style_context().add_class("dim-label");
|
||||||
box.add(desc_label);
|
box.add(desc_label);
|
||||||
|
@ -117,7 +117,7 @@ public class Dialog : Gtk.Dialog {
|
||||||
|
|
||||||
int pref_height, pref_width;
|
int pref_height, pref_width;
|
||||||
get_content_area().get_preferred_height(null, out pref_height);
|
get_content_area().get_preferred_height(null, out pref_height);
|
||||||
get_preferred_width(out pref_width, null);
|
get_default_size(out pref_width, null);
|
||||||
resize(pref_width, int.min(500, pref_height));
|
resize(pref_width, int.min(500, pref_height));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue