aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/unified_window_controller.vala
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/unified_window_controller.vala')
-rw-r--r--main/src/ui/unified_window_controller.vala24
1 files changed, 7 insertions, 17 deletions
diff --git a/main/src/ui/unified_window_controller.vala b/main/src/ui/unified_window_controller.vala
index 9e41aff8..2ee1c452 100644
--- a/main/src/ui/unified_window_controller.vala
+++ b/main/src/ui/unified_window_controller.vala
@@ -19,7 +19,7 @@ public class UnifiedWindowController : Object {
private SearchMenuEntry search_menu_entry = new SearchMenuEntry();
- private ChatInputController chat_input_controller;
+ private ConversationViewController conversation_view_controller;
public UnifiedWindowController(Application application, StreamInteractor stream_interactor, Database db) {
this.app = application;
@@ -54,18 +54,15 @@ public class UnifiedWindowController : Object {
public void set_window(UnifiedWindow window) {
this.window = window;
- this.chat_input_controller = new ChatInputController(window.chat_input, stream_interactor);
+ this.conversation_view_controller = new ConversationViewController(window.conversation_view, stream_interactor);
this.bind_property("conversation-display-name", window, "title");
this.bind_property("conversation-topic", window, "subtitle");
search_menu_entry.search_button.bind_property("active", window.search_revealer, "reveal_child");
- window.goto_end_button.clicked.connect(() => {
- window.conversation_frame.initialize_for_conversation(conversation);
- });
window.search_revealer.notify["child-revealed"].connect(() => {
if (window.search_revealer.child_revealed) {
- if (window.conversation_frame.conversation != null && window.search_box.search_entry.text == "") {
+ if (window.conversation_view.conversation_frame.conversation != null && window.search_box.search_entry.text == "") {
reset_search_entry();
}
window.search_box.search_entry.grab_focus_without_selecting();
@@ -74,7 +71,7 @@ public class UnifiedWindowController : Object {
});
window.search_box.selected_item.connect((item) => {
select_conversation(item.conversation, false, false);
- window.conversation_frame.initialize_around_message(item.conversation, item);
+ window.conversation_view.conversation_frame.initialize_around_message(item.conversation, item);
close_search();
});
@@ -88,10 +85,6 @@ public class UnifiedWindowController : Object {
window.conversations_placeholder.secondary_button.clicked.connect(() => { app.activate_action("add_conference", null); });
window.conversation_selector.conversation_selected.connect((conversation) => select_conversation(conversation));
- var vadjustment = window.conversation_frame.scrolled.vadjustment;
- vadjustment.notify["value"].connect(() => {
- window.goto_end_revealer.reveal_child = vadjustment.value < vadjustment.upper - vadjustment.page_size;
- });
window.event.connect((event) => {
if (event.type == EventType.BUTTON_PRESS) {
int dest_x, dest_y;
@@ -124,6 +117,8 @@ public class UnifiedWindowController : Object {
public void select_conversation(Conversation? conversation, bool do_reset_search = true, bool default_initialize_conversation = true) {
this.conversation = conversation;
+ conversation_view_controller.select_conversation(conversation, default_initialize_conversation);
+
update_conversation_display_name();
update_conversation_topic();
@@ -141,11 +136,6 @@ public class UnifiedWindowController : Object {
if (do_reset_search) {
reset_search_entry();
}
- chat_input_controller.set_conversation(conversation);
- window.chat_input.initialize_for_conversation(conversation);
- if (default_initialize_conversation) {
- window.conversation_frame.initialize_for_conversation(conversation);
- }
}
private void check_unset_conversation() {
@@ -188,7 +178,7 @@ public class UnifiedWindowController : Object {
}
private void reset_search_entry() {
- if (window.conversation_frame.conversation != null) {
+ if (window.conversation_view.conversation_frame.conversation != null) {
switch (conversation.type_) {
case Conversation.Type.CHAT:
case Conversation.Type.GROUPCHAT_PM: