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"?>
|
||||
<interface>
|
||||
<template class="DinoUiContactDetailsDialog">
|
||||
<property name="default_width">800</property>
|
||||
<property name="modal">True</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
|
@ -20,6 +21,12 @@
|
|||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="expand">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>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
|
@ -28,8 +35,6 @@
|
|||
<object class="GtkGrid">
|
||||
<property name="margin-top">20</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="visible">True</property>
|
||||
<child>
|
||||
|
@ -99,8 +104,8 @@
|
|||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
|
@ -110,8 +115,6 @@
|
|||
<child>
|
||||
<object class="GtkBox" id="main_box">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-right">100</property>
|
||||
<property name="margin-left">100</property>
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
@ -121,5 +124,7 @@
|
|||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
|
|
|
@ -85,11 +85,11 @@ public class Dialog : Gtk.Dialog {
|
|||
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 };
|
||||
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 != "") {
|
||||
Box box = new Box(Orientation.VERTICAL, 0) { visible=true };
|
||||
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.get_style_context().add_class("dim-label");
|
||||
box.add(desc_label);
|
||||
|
@ -117,7 +117,7 @@ public class Dialog : Gtk.Dialog {
|
|||
|
||||
int pref_height, pref_width;
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue