[gnome-contacts] Make right hand side card display more like new mockup
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Make right hand side card display more like new mockup
- Date: Mon, 22 Aug 2011 14:48:56 +0000 (UTC)
commit 316e5bc2316f3e28b510f1a64036e8b2acbe093c
Author: Alexander Larsson <alexl redhat com>
Date: Mon Aug 22 16:48:36 2011 +0200
Make right hand side card display more like new mockup
src/contacts-contact-pane.vala | 7 ++++---
src/contacts-contact.vala | 12 +++++++-----
2 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 8ebbeed..f3fa60d 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -57,7 +57,7 @@ class Contacts.DetailsLayout : Object {
var grid = new Grid ();
expands = false;
last_label = null;
- grid.set_row_spacing (8);
+ grid.set_row_spacing (9);
grid.set_orientation (Orientation.HORIZONTAL);
if (current_row != null) {
Utils.grid_insert_row_after (fields_grid, current_row, true);
@@ -190,8 +190,8 @@ public class Contacts.ContactFrame : Frame {
image.set_size_request (size, size);
this.add (image);
- get_style_context ().add_class ("contact-frame");
- set_shadow_type (ShadowType.OUT);
+ //get_style_context ().add_class ("contact-frame");
+ set_shadow_type (ShadowType.NONE);
}
public void set_image (AvatarDetails? details, Contact? contact = null) {
@@ -209,6 +209,7 @@ public class Contacts.ContactFrame : Frame {
if (pixbuf == null) {
pixbuf = Contact.draw_fallback_avatar (size, contact);
}
+ pixbuf = Contact.frame_icon (pixbuf);
}
public void set_text (string? text_, int text_height_) {
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index 5f8d06e..199490c 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -750,21 +750,23 @@ public class Contacts.Contact : GLib.Object {
Math.PI / 2, Math.PI);
}
- private static Gdk.Pixbuf frame_icon (Gdk.Pixbuf icon) {
- var cst = new Cairo.ImageSurface (Cairo.Format.ARGB32, 48, 48);
+ public static Gdk.Pixbuf frame_icon (Gdk.Pixbuf icon) {
+ int w = icon.get_width ();
+ int h = icon.get_height ();
+ var cst = new Cairo.ImageSurface (Cairo.Format.ARGB32, w, h);
var cr = new Cairo.Context (cst);
cr.set_source_rgba (0, 0, 0, 0);
- cr.rectangle (0, 0, 48, 48);
+ cr.rectangle (0, 0, w, h);
cr.fill ();
Gdk.cairo_set_source_pixbuf (cr, icon, 0, 0);
rounded_box_path (cr,
0, 0,
- 48, 48, 4);
+ w, h, 4);
cr.fill ();
- return Gdk.pixbuf_get_from_surface (cst, 0, 0, 48, 48);
+ return Gdk.pixbuf_get_from_surface (cst, 0, 0, w, h);
}
private static Gdk.Pixbuf? fallback_pixbuf_48;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]