Commit 3b90a5e2 authored by Julian Sparber's avatar Julian Sparber

contact-sheet: resize avatar based on width

parent 0c1bfadc
......@@ -79,6 +79,18 @@ public class Contacts.ContactSheet : ContactForm {
var image_frame = new Avatar (PROFILE_SIZE, this.contact);
image_frame.set_vexpand (false);
image_frame.set_valign (Align.START);
/* Resize the avatar based on the avabile space */
size_allocate.connect(() => {
Allocation size;
get_allocation(out size);
if (size.width < 400) {
image_frame.set_display_size (PROFILE_SMALL_SIZE);
} else {
image_frame.set_display_size (PROFILE_SIZE);
}
});
this.container_grid.attach (image_frame, 0, 0, 1, 3);
create_name_label ();
......
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