diff options
| author | fiaxh <git@mx.ax.lt> | 2017-03-10 19:53:24 +0100 |
|---|---|---|
| committer | fiaxh <git@mx.ax.lt> | 2017-03-10 19:53:24 +0100 |
| commit | 24b55d83a1f9e21b028c8d5ac9778e75565f417d (patch) | |
| tree | 195b0f332e32d08e1a18fc3d8a5a6725c5ed11d7 /client/src/ui/conversation_selector/view.vala | |
| parent | 4c48c5c16d5f5b010c2e5dfb1affcb59f937510c (diff) | |
| parent | 29ca70a6d534e1cd79963718c793ae740318cff1 (diff) | |
| download | dino-24b55d83a1f9e21b028c8d5ac9778e75565f417d.tar.gz | |
Merge branch 'master' of github.com:dino/dino
Diffstat (limited to 'client/src/ui/conversation_selector/view.vala')
| -rw-r--r-- | client/src/ui/conversation_selector/view.vala | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/client/src/ui/conversation_selector/view.vala b/client/src/ui/conversation_selector/view.vala deleted file mode 100644 index ae641664..00000000 --- a/client/src/ui/conversation_selector/view.vala +++ /dev/null @@ -1,52 +0,0 @@ -using Gee; -using Gtk; -using Gdk; - -using Dino.Entities; - -namespace Dino.Ui.ConversationSelector { - -[GtkTemplate (ui = "/org/dino-im/conversation_selector/view.ui")] -public class View : Grid { - public List conversation_list; - - [GtkChild] public SearchEntry search_entry; - [GtkChild] public SearchBar search_bar; - [GtkChild] private ScrolledWindow scrolled; - - public View(StreamInteractor stream_interactor) { - conversation_list = new List(stream_interactor); - scrolled.add(conversation_list); - search_entry.key_release_event.connect(search_key_release_event); - search_entry.search_changed.connect(search_changed); - } - - public void conversation_selected(Conversation? conversation) { - search_entry.set_text(""); - } - - private void refilter() { - string[]? values = null; - string str = search_entry.get_text (); - if (str != "") values = str.split(" "); - conversation_list.set_filter_values(values); - } - - private void search_changed(Editable editable) { - refilter(); - } - - private bool search_key_release_event(EventKey event) { - conversation_list.select_row(conversation_list.get_row_at_y(0)); - if (event.keyval == Key.Down) { - ConversationRow? row = (ConversationRow) conversation_list.get_row_at_index(0); - if (row != null) { - conversation_list.select_row(row); - row.grab_focus(); - } - } - return false; - } -} - -}
\ No newline at end of file |
