aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_selector/view.vala
diff options
context:
space:
mode:
authorfiaxh <fiaxh@users.noreply.github.com>2018-08-31 16:25:51 +0200
committerGitHub <noreply@github.com>2018-08-31 16:25:51 +0200
commitecb18afdb51b3230ea451a27a5b345cf5100f02e (patch)
tree44bae666c4cc31afce3a5d6891f6b4f65dfcebb1 /main/src/ui/conversation_selector/view.vala
parent9e93a77a624aed24402cf1ece69c05aaa0aab600 (diff)
parentf5547076d2397cec5c9d7374bd161f93327488c4 (diff)
downloaddino-ecb18afdb51b3230ea451a27a5b345cf5100f02e.tar.gz
dino-ecb18afdb51b3230ea451a27a5b345cf5100f02e.zip
Merge pull request #415 from bobufa/message-search
Message search
Diffstat (limited to 'main/src/ui/conversation_selector/view.vala')
-rw-r--r--main/src/ui/conversation_selector/view.vala33
1 files changed, 2 insertions, 31 deletions
diff --git a/main/src/ui/conversation_selector/view.vala b/main/src/ui/conversation_selector/view.vala
index b6b02848..d06ad133 100644
--- a/main/src/ui/conversation_selector/view.vala
+++ b/main/src/ui/conversation_selector/view.vala
@@ -10,43 +10,14 @@ namespace Dino.Ui.ConversationSelector {
public class View : Box {
public List conversation_list;
- [GtkChild] public SearchEntry search_entry;
- [GtkChild] public Revealer search_revealer;
[GtkChild] private ScrolledWindow scrolled;
- public View(StreamInteractor stream_interactor) {
+ public View init(StreamInteractor stream_interactor) {
conversation_list = new List(stream_interactor) { visible=true };
scrolled.add(conversation_list);
- search_entry.key_release_event.connect(search_key_release_event);
- search_entry.search_changed.connect(search_changed);
+ return this;
}
- 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;
- }
}
}