4
Copyright (C) 2013 Friends Developers
5
This program is free software: you can redistribute it and/or modify it
6
under the terms of the GNU Lesser General Public License version 3, as
7
published by the Free Software Foundation.
9
This program is distributed in the hope that it will be useful, but
10
WITHOUT ANY WARRANTY; without even the implied warranties of
11
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12
PURPOSE. See the GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License along
15
with this program. If not, see <http://www.gnu.org/licenses>
20
public class Friends.Widget.RequestBox : Gtk.Box {
21
public Gtk.Button accept_button;
23
public RequestBox (TelepathyGLib.Contact contact) {
25
this.margin_bottom = 10;
26
this.margin_right = 10;
27
this.margin_left = 10;
29
var avatar = Friends.Lib.TelepathyManager.load_image (contact);
30
avatar.margin_right = 5;
31
this.pack_start (avatar, false, true);
33
var central_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
34
var central_hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
35
var central_hbox2 = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
36
var name2 = new Gtk.Label (contact.alias);
37
name2.margin_left = 10;
38
name2.set_markup("<b>" + contact.alias + "</b>");
39
name2.ellipsize = Pango.EllipsizeMode.END;
40
central_hbox.pack_start (name2,false,true);
41
var kind = new Gtk.Label ("2 friends in common");
43
var css = new Gtk.CssProvider ();
46
css.load_from_data ("*{color: #666;}",-1);
47
} catch (GLib.Error e) {
48
critical("Error: %s\n", e.message);
50
kind.get_style_context ().add_provider (css,600);
52
kind.margin_right = 10;
53
central_hbox.add (kind);
55
central_box.pack_start (central_hbox, true, true);
56
var text = new Gtk.Label ("Colorado");
57
text.margin_left = 10;
58
text.ellipsize = Pango.EllipsizeMode.END;
59
central_hbox2.pack_start (text,false,true);
60
central_box.add (central_hbox2);
61
this.pack_start (central_box,false,true);
63
var hbox_status = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
64
hbox_status.margin_top = 5;
65
hbox_status.margin_bottom = 5;
66
var delete_button = new Gtk.Button ();
67
delete_button.add (new Gtk.Image.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.SMALL_TOOLBAR));
68
delete_button.margin_right = 10;
70
accept_button = new Gtk.Button();
71
accept_button.add (new Gtk.Image.from_icon_name ("contact-new-symbolic", Gtk.IconSize.BUTTON));
73
hbox_status.add (delete_button);
74
hbox_status.add (accept_button);
76
this.pack_end (hbox_status, false, true);
b'\\ No newline at end of file'