diff options
author | fiaxh <git@lightrise.org> | 2022-02-14 14:55:59 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2022-07-27 20:34:20 +0200 |
commit | 7e7dcedaf31ee35499875491c9f569c575d28435 (patch) | |
tree | 0c5fee2b28baf320775fbc92b3c252e97d9d054f /main/src/ui/conversation_list/conversation_list_row.vala | |
parent | f25bfb00969a7e09996da2d5500e6718f4cc0148 (diff) | |
download | dino-7e7dcedaf31ee35499875491c9f569c575d28435.tar.gz dino-7e7dcedaf31ee35499875491c9f569c575d28435.zip |
Port from GTK3 to GTK4
Diffstat (limited to 'main/src/ui/conversation_list/conversation_list_row.vala')
-rw-r--r-- | main/src/ui/conversation_list/conversation_list_row.vala | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/main/src/ui/conversation_list/conversation_list_row.vala b/main/src/ui/conversation_list/conversation_list_row.vala new file mode 100644 index 00000000..ab4e8cee --- /dev/null +++ b/main/src/ui/conversation_list/conversation_list_row.vala @@ -0,0 +1,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); + } + } +}
\ No newline at end of file |