aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/ui/conversation_summary/status_item.vala
blob: 0775d8f3f6a729f5ccd0be42f75d6c2e6934bced (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Gtk;
using Markup;

using Dino.Entities;

namespace Dino.Ui.ConversationSummary {

private class StatusItem : Grid {

    private Image image = new Image();
    private Label label = new Label("");

    private StreamInteractor stream_interactor;
    private Conversation conversation;

    public StatusItem(StreamInteractor stream_interactor, Conversation conversation, string? text) {
        Object(column_spacing : 7);
        set_hexpand(true);
        this.stream_interactor = stream_interactor;
        this.conversation = conversation;
        image.set_from_pixbuf((new AvatarGenerator(30, 30)).set_greyscale(true).draw_conversation(stream_interactor, conversation));
        attach(image, 0, 0, 1, 1);
        attach(label, 1, 0, 1, 1);
        string display_name = Util.get_display_name(stream_interactor, conversation.counterpart, conversation.account);
        label.set_markup(@"<span foreground=\"#B1B1B1\"> $(escape_text(display_name)) $text </span>");
        show_all();
    }
}

}