Skip to content
Snippets Groups Projects
Commit 36ac0aa3 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#4878] Set keyboard focus on searchbar when selecting addressbook

parent 0776a869
Branches
Tags
No related merge requests found
......@@ -41,6 +41,7 @@
#include "uimanager.h"
#include "actions.h"
#include "../imwindow.h"
#include "searchbar.h"
GtkWidget *sw;
GtkCellRenderer *rend;
......@@ -1400,6 +1401,8 @@ void calltree_display (calltab_t *tab)
}
gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton, TRUE);
set_forcus_on_addressbook_searchbar();
}
else
......
......@@ -53,7 +53,6 @@ GdkPixbuf *outgoing_pixbuf = NULL;
GdkPixbuf *missed_pixbuf = NULL;
void searchbar_addressbook_activated (GtkEntry *entry, gchar *arg1 UNUSED, gpointer data UNUSED)
{
DEBUG ("Searchbar: Entry activated");
......@@ -86,6 +85,11 @@ static void cbox_changed_cb (GtkWidget *widget, gpointer user_data UNUSED)
addressbook_search (GTK_ENTRY (addressbookentry));
}
void set_forcus_on_addressbook_searchbar ()
{
gtk_widget_grab_focus (addressbookentry);
}
void update_searchbar_addressbook_list()
{
gint count;
......@@ -263,7 +267,7 @@ GtkWidget *addressbook_menu_new (void)
void
focus_on_searchbar_out()
{
DEBUG ("set_focus_on_searchbar_out");
DEBUG ("Searchbar: Unset focus from search bar");
// gtk_widget_grab_focus(GTK_WIDGET(sw));
focus_is_on_searchbar = FALSE;
}
......@@ -271,7 +275,7 @@ focus_on_searchbar_out()
void
focus_on_searchbar_in()
{
DEBUG ("set_focus_on_searchbar_in");
DEBUG ("Searchbar: Set focus on search bar");
// gtk_widget_grab_focus(GTK_WIDGET(sw));
focus_is_on_searchbar = TRUE;
}
......
......@@ -57,15 +57,20 @@ GdkPixbuf *waitingPixOff;
SearchType HistorySearchType;
/**
* Create a new search bar with "type" passed in
* parameter
* Create a new search bar for call hostory
*/
GtkWidget* history_searchbar_new (void);
/**
* Create a new search bar for addressbook
*/
GtkWidget* contacts_searchbar_new (void);
/**
* Get type of call to be search from call history
*/
SearchType get_current_history_search_type (void);
/**
* Initialize a specific search bar
*/
......@@ -81,11 +86,19 @@ void activateWaitingLayer();
*/
void deactivateWaitingLayer();
/**
* Set focus on addressbook search bar
*/
void set_forcus_on_addressbook_searchbar (void);
/**
* Reload combo box to update list of active addressbook
*/
void update_searchbar_addressbook_list (void);
/**
* Create a new menu listing all system addressbooks
*/
GtkWidget *addressbook_menu_new (void);
#endif
......@@ -112,12 +112,6 @@ void statusbar_pop_message (guint id);
*/
void statusbar_update_clock (gchar *time);
//static gboolean
//on_key_released (GtkWidget *widget, GdkEventKey *event,
// gpointer user_data);
// void set_focus_on_mainwindow();
gboolean focus_is_on_calltree;
gboolean focus_is_on_searchbar;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment