aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-search-bar.c
diff options
context:
space:
mode:
authorThomas Meire <blackskad@gmail.com>2010-01-20 01:39:52 +0800
committerThomas Meire <blackskad@gmail.com>2010-01-21 08:20:08 +0800
commit6e4d8ededbb01dfd7bf5bbbb31fc05d6d6ca161a (patch)
treeaabb769288946b6cb07aec1d40bdd742c5f48747 /libempathy-gtk/empathy-search-bar.c
parentba2326210afd63d1ae622c57b76b3b1f56ab4e9e (diff)
downloadgsoc2013-empathy-6e4d8ededbb01dfd7bf5bbbb31fc05d6d6ca161a.tar
gsoc2013-empathy-6e4d8ededbb01dfd7bf5bbbb31fc05d6d6ca161a.tar.gz
gsoc2013-empathy-6e4d8ededbb01dfd7bf5bbbb31fc05d6d6ca161a.tar.bz2
gsoc2013-empathy-6e4d8ededbb01dfd7bf5bbbb31fc05d6d6ca161a.tar.lz
gsoc2013-empathy-6e4d8ededbb01dfd7bf5bbbb31fc05d6d6ca161a.tar.xz
gsoc2013-empathy-6e4d8ededbb01dfd7bf5bbbb31fc05d6d6ca161a.tar.zst
gsoc2013-empathy-6e4d8ededbb01dfd7bf5bbbb31fc05d6d6ca161a.zip
improve behaviour of match_case callback
Diffstat (limited to 'libempathy-gtk/empathy-search-bar.c')
-rw-r--r--libempathy-gtk/empathy-search-bar.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-search-bar.c b/libempathy-gtk/empathy-search-bar.c
index 87263338c..2526510b2 100644
--- a/libempathy-gtk/empathy-search-bar.c
+++ b/libempathy-gtk/empathy-search-bar.c
@@ -121,18 +121,34 @@ empathy_search_bar_update_buttons (EmpathySearchBar *self,
can_go_forward && !EMP_STR_EMPTY (search));
}
-void
-empathy_search_bar_show (EmpathySearchBar *self)
+static void
+empathy_search_bar_update (EmpathySearchBar *self)
{
gchar *search;
gboolean match_case;
EmpathySearchBarPriv *priv = GET_PRIV (self);
- search = gtk_editable_get_chars (GTK_EDITABLE (priv->search_entry), 0, -1);
- match_case = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->search_match_case));
- empathy_chat_view_highlight (priv->chat_view, search, TRUE);
+ search = gtk_editable_get_chars (GTK_EDITABLE(priv->search_entry), 0, -1);
+ match_case = gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (priv->search_match_case));
+
+ /* highlight & search */
+ empathy_chat_view_highlight (priv->chat_view, search, match_case);
+
+ /* update the buttons */
empathy_search_bar_update_buttons (self, search, match_case);
+ g_free (search);
+}
+
+void
+empathy_search_bar_show (EmpathySearchBar *self)
+{
+ EmpathySearchBarPriv *priv = GET_PRIV (self);
+
+ /* update the highlighting and buttons */
+ empathy_search_bar_update (self);
+
/* grab the focus to the search entry */
gtk_widget_grab_focus (priv->search_entry);
@@ -221,7 +237,7 @@ static void
empathy_search_bar_match_case_toggled (GtkButton *button,
gpointer user_data)
{
- empathy_search_bar_search (EMPATHY_SEARCH_BAR (user_data), TRUE, FALSE);
+ empathy_search_bar_update (EMPATHY_SEARCH_BAR (user_data));
}
static void