[gnome-contacts] Make links look like mockup
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Make links look like mockup
- Date: Wed, 8 Jun 2011 20:35:07 +0000 (UTC)
commit c7b6cf82fd8be2ade8cdf681217ab838d7f6181f
Author: Alexander Larsson <alexl redhat com>
Date: Wed Jun 8 12:00:26 2011 +0200
Make links look like mockup
src/contacts-app.vala | 29 +++++++++++++++++++----------
1 files changed, 19 insertions(+), 10 deletions(-)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 499eb27..f2b10a5 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -123,15 +123,7 @@ public class Contacts.App : Window {
private struct DetailsRow {
Grid grid;
- Label label;
- }
-
- private void add_label_spacer () {
- if (fields_grid.get_children () != null) {
- var grid = new Grid ();
- grid.set_size_request (8, 8);
- fields_grid.add (grid);
- }
+ Widget label;
}
private void add_label (string label, out DetailsRow row) {
@@ -161,6 +153,20 @@ public class Contacts.App : Window {
row.grid.add (v);
}
+ private void add_link (string uri, string text, ref DetailsRow row) {
+ var v = new LinkButton.with_label (uri, text);
+ v.set_valign (Align.CENTER);
+ v.set_halign (Align.START);
+ v.show ();
+
+ if (row.label != null)
+ row.grid.attach_next_to (v, row.label, PositionType.BOTTOM, 1, 1);
+ else
+ row.grid.add (v);
+
+ row.label = v;
+ }
+
private void add_extra_row (string val, ref DetailsRow row) {
var more_label = new Label (val);
more_label.set_selectable (true);
@@ -358,7 +364,10 @@ public class Contacts.App : Window {
}
add_string_property_label (_("Alias"), contact, "alias", out row);
- add_string_label (_("Twitter"), "mytwittername", out row);
+
+ add_label ("Links", out row);
+ add_link ("http://www.twitter.com", _("Twitter"), ref row);
+ add_link ("http://www.facebook.com", _("Facebook"), ref row);
fields_grid.show_all ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]