mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Set focus on textfield when loading a chatroom
This commit is contained in:
parent
d1f2b1d28f
commit
71cf28204c
2 changed files with 17 additions and 1 deletions
15
gtk/main.c
15
gtk/main.c
|
|
@ -1031,6 +1031,21 @@ void on_proxy_refresh_button_clicked(GtkWidget *w){
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean grab_focus(GtkWidget *w){
|
||||
gtk_widget_grab_focus(w);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void linphone_gtk_viewswitch_changed(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data){
|
||||
GtkWidget *main_window = linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist = linphone_gtk_get_widget(main_window,"contact_list");
|
||||
GtkWidget *w = (GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview");
|
||||
|
||||
if (page_num == gtk_notebook_page_num(GTK_NOTEBOOK(notebook),w)) {
|
||||
g_idle_add((GSourceFunc)grab_focus,linphone_gtk_get_widget(page,"text_entry"));
|
||||
}
|
||||
}
|
||||
|
||||
static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid){
|
||||
linphone_gtk_show_friends();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,8 +167,8 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="activate" handler="linphone_gtk_show_parameters" swapped="no"/>
|
||||
<accelerator key="p" signal="activate" modifiers="GDK_CONTROL_MASK"/>
|
||||
<signal name="activate" handler="linphone_gtk_show_parameters" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -650,6 +650,7 @@
|
|||
<object class="GtkNotebook" id="viewswitch">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<signal name="switch-page" handler="linphone_gtk_viewswitch_changed" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue