Commit 2deca77f authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Sébastien Blin

currentcallview: fix DTMF focus

- current_call_view now receives mouse click to grab focus
- remove useless search box in conversationsview

Change-Id: I8bf9e94fda1e2387b1dda7eecedf957b6d9fc09a
parent a9a8e9d2
......@@ -563,6 +563,8 @@ build_conversations_view(ConversationsView *self)
gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model));
gtk_tree_view_set_enable_search(GTK_TREE_VIEW(self), false);
// ringId method column
auto area = gtk_cell_area_box_new();
auto column = gtk_tree_view_column_new_with_area(area);
......
......@@ -1294,3 +1294,11 @@ current_call_view_new(WebKitChatContainer* chat_widget,
priv->cpp->setup(chat_widget, accountInfo, conversation, avModel);
return GTK_WIDGET(self);
}
void
current_call_view_handup_focus(GtkWidget *current_call_view)
{
auto* priv = CURRENT_CALL_VIEW_GET_PRIVATE(current_call_view);
gtk_widget_set_can_focus (priv->button_hangup, true);
gtk_widget_grab_focus(priv->button_hangup);
}
......@@ -58,5 +58,6 @@ GtkWidget *current_call_view_new (WebKitChatContainer* view,
lrc::api::conversation::Info current_call_view_get_conversation(CurrentCallView*);
GtkWidget *current_call_view_get_chat_view(CurrentCallView*);
void current_call_view_show_chat(CurrentCallView*);
void current_call_view_handup_focus(GtkWidget *current_call_view);
G_END_DECLS
......@@ -604,6 +604,15 @@ on_search_entry_key_released(G_GNUC_UNUSED GtkEntry* search_entry, GdkEventKey*
return GDK_EVENT_PROPAGATE;
}
static gboolean
on_current_call_clicked(GtkWidget *widget, G_GNUC_UNUSED GdkEventButton *event)
{
// once mouse is clicked, grab the focus
gtk_widget_set_can_focus (widget, true);
gtk_widget_grab_focus(widget);
return GDK_EVENT_PROPAGATE;
}
static gboolean
on_dtmf_pressed(RingMainWindow* self, GdkEventKey* event, gpointer user_data)
{
......@@ -1347,6 +1356,11 @@ CppImpl::changeView(GType type, lrc::api::conversation::Info conversation)
conversations_view_select_conversation(
CONVERSATIONS_VIEW(widgets->treeview_conversations),
conversation.uid);
// grab focus for handup button for current call view
if (g_type_is_a(CURRENT_CALL_VIEW_TYPE, type)){
current_call_view_handup_focus(new_view);
}
}
GtkWidget*
......@@ -1388,6 +1402,7 @@ CppImpl::displayCurrentCallView(lrc::api::conversation::Info conversation, bool
g_signal_connect_swapped(new_view, "video-double-clicked",
G_CALLBACK(on_video_double_clicked), self);
g_signal_connect(new_view, "button-press-event", G_CALLBACK(on_current_call_clicked), nullptr);
return new_view;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment