Commit f1de6bbb authored by Julian Sparber's avatar Julian Sparber

contact-editor: fix styling for persona labels and unlink button

parent a5a3953e
......@@ -345,25 +345,33 @@ public class Contacts.ContactEditor : ContactForm {
var personas = this.contact.get_personas_for_display ();
foreach (var p in personas) {
if (!is_first_persona) {
this.container_grid.attach (create_persona_store_label (p), 0, i, 2);
var unlink_button = new Button.with_label(_("unlink"));
var box = new Box (Orientation.HORIZONTAL, 12);
box.set_margin_top (18);
box.set_margin_bottom (9);
box.pack_start (create_persona_store_label (p));
var unlink_button = new Button.with_label (_("Unlink Account"));
unlink_button.set_halign (Align.END);
/* Keep the state of the button */
var unlink = true;
unlink_button.clicked.connect(() => {
if (unlink) {
unlink_button.set_label(_("link"));
unlink_button.set_label (_("Link Account"));
unlink = false;
unlink_personas.add (p);
} else {
unlink_button.set_label(_("unlink"));
unlink_button.set_label (_("Unlink Account"));
unlink = true;
unlink_personas.remove (p);
}
});
this.container_grid.attach (unlink_button, 1, i, 2);
box.pack_end (unlink_button);
this.container_grid.attach (box, 0, i, 3);
last_store_position = ++i;
}
......
......@@ -78,12 +78,12 @@ public abstract class Contacts.ContactForm : Grid {
}
protected Label create_persona_store_label (Persona p) {
var store_name = new Label("");
store_name.set_markup (Markup.printf_escaped ("<span font='16px bold'>%s</span>",
Contact.format_persona_store_name_for_contact (p)));
var store_name = new Label (Contact.format_persona_store_name_for_contact (p));
var attrList = new Pango.AttrList ();
attrList.insert (Pango.attr_weight_new (Pango.Weight.BOLD));
store_name.set_attributes (attrList);
store_name.set_halign (Align.START);
store_name.xalign = 0.0f;
store_name.margin_start = 6;
store_name.set_ellipsize (Pango.EllipsizeMode.MIDDLE);
return store_name;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment