aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_list/conversation_list_row.vala
blob: ab4e8ceee0cd3702ab433086e2dc381176ca92d9 (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
31
32
33
34
35
36
37
38
39
40
41
using Gee;
using Gdk;
using Gtk;
using Pango;

using Dino;
using Dino.Entities;
using Xmpp;

[GtkTemplate (ui = "/im/dino/Dino/conversation_row.ui")]
public class Dino.Ui.ConversationListRow : ListBoxRow {

    [GtkChild] public unowned AvatarImage image;
    [GtkChild] public unowned Label name_label;
    [GtkChild] public unowned Label time_label;
    [GtkChild] public unowned Label nick_label;
    [GtkChild] public unowned Label message_label;
    [GtkChild] public unowned Label unread_count_label;
    [GtkChild] public unowned Button x_button;
    [GtkChild] public unowned Revealer time_revealer;
    [GtkChild] public unowned Revealer xbutton_revealer;
    [GtkChild] public unowned Revealer unread_count_revealer;
    [GtkChild] public unowned Revealer main_revealer;

    construct {
        name_label.attributes = new AttrList();
    }

    public override void state_flags_changed(StateFlags flags) {
        StateFlags curr_flags = get_state_flags();
        if ((curr_flags & StateFlags.PRELIGHT) != 0) {
            time_revealer.set_reveal_child(false);
            unread_count_revealer.set_reveal_child(false);
            xbutton_revealer.set_reveal_child(true);
        } else {
            time_revealer.set_reveal_child(true);
            unread_count_revealer.set_reveal_child(true);
            xbutton_revealer.set_reveal_child(false);
        }
    }
}