[gnome-photos] main-toolbar, searchbar: Implement is_focus



commit 8ae4c85e67b28ddd55a70ddaed92c4582b85e4f3
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Jan 29 14:10:11 2014 +0100

    main-toolbar, searchbar: Implement is_focus
    
    ... to find out if the focus is inside the search entry.

 src/photos-main-toolbar.c |    7 +++++++
 src/photos-main-toolbar.h |    2 ++
 src/photos-searchbar.c    |    7 +++++++
 src/photos-searchbar.h    |    2 ++
 4 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index 3f6574b..981a53d 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -795,6 +795,13 @@ photos_main_toolbar_handle_event (PhotosMainToolbar *self, GdkEventKey *event)
 }
 
 
+gboolean
+photos_main_toolbar_is_focus (PhotosMainToolbar *self)
+{
+  return photos_searchbar_is_focus (PHOTOS_SEARCHBAR (self->priv->searchbar));
+}
+
+
 void
 photos_main_toolbar_set_stack (PhotosMainToolbar *self, GtkStack *stack)
 {
diff --git a/src/photos-main-toolbar.h b/src/photos-main-toolbar.h
index b246885..0d217bd 100644
--- a/src/photos-main-toolbar.h
+++ b/src/photos-main-toolbar.h
@@ -72,6 +72,8 @@ GtkWidget             *photos_main_toolbar_new                    (GtkOverlay *o
 
 gboolean               photos_main_toolbar_handle_event           (PhotosMainToolbar *self, GdkEventKey 
*event);
 
+gboolean               photos_main_toolbar_is_focus               (PhotosMainToolbar *self);
+
 void                   photos_main_toolbar_set_stack              (PhotosMainToolbar *self, GtkStack *stack);
 
 G_END_DECLS
diff --git a/src/photos-searchbar.c b/src/photos-searchbar.c
index 7e2aa98..5356dfc 100644
--- a/src/photos-searchbar.c
+++ b/src/photos-searchbar.c
@@ -319,6 +319,13 @@ photos_searchbar_hide (PhotosSearchbar *self)
 }
 
 
+gboolean
+photos_searchbar_is_focus (PhotosSearchbar *self)
+{
+  return gtk_widget_is_focus (self->priv->search_entry);
+}
+
+
 void
 photos_searchbar_set_search_change_blocked (PhotosSearchbar *self, gboolean search_change_blocked)
 {
diff --git a/src/photos-searchbar.h b/src/photos-searchbar.h
index e6b564d..885814a 100644
--- a/src/photos-searchbar.h
+++ b/src/photos-searchbar.h
@@ -80,6 +80,8 @@ gboolean             photos_searchbar_handle_event                  (PhotosSearc
 
 void                 photos_searchbar_hide                          (PhotosSearchbar *self);
 
+gboolean             photos_searchbar_is_focus                      (PhotosSearchbar *self);
+
 void                 photos_searchbar_set_search_change_blocked     (PhotosSearchbar *self,
                                                                      gboolean search_change_blocked);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]