summaryrefslogtreecommitdiff
path: root/libslab/search-bar.c
diff options
context:
space:
mode:
authorZhang Xianwei <[email protected]>2018-01-07 16:07:12 +0800
committerZhang Xianwei <[email protected]>2018-01-11 09:59:45 +0800
commitafcb324eb181a9c6cb0b3c8e8589ed99391a63a0 (patch)
tree3fe5cf0b331c06cb7b86c658e41a548cd2bbc460 /libslab/search-bar.c
parenta34ea4de6c653e184bf5eeef17dd2d73a9955fb1 (diff)
downloadmate-control-center-afcb324eb181a9c6cb0b3c8e8589ed99391a63a0.tar.bz2
mate-control-center-afcb324eb181a9c6cb0b3c8e8589ed99391a63a0.tar.xz
libslab: fix search icon misaligned
Make use GtkSearchEntry instead of builtin NldSearchEntry fixes #299 Signed-off-by: Zhang Xianwei <[email protected]>
Diffstat (limited to 'libslab/search-bar.c')
-rw-r--r--libslab/search-bar.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libslab/search-bar.c b/libslab/search-bar.c
index fd480f34..7645c0fa 100644
--- a/libslab/search-bar.c
+++ b/libslab/search-bar.c
@@ -21,7 +21,6 @@
#include "search-bar.h"
#include "config.h"
-#include "search-entry.h"
#include "search-context-picker.h"
#include "nld-marshal.h"
@@ -31,7 +30,7 @@ typedef struct
{
GtkWidget *hbox;
NldSearchContextPicker *context_picker;
- GtkEntry *entry;
+ GtkSearchEntry *entry;
GtkWidget *button;
int search_timeout;
@@ -92,10 +91,10 @@ nld_search_bar_init (NldSearchBar * search_bar)
priv->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_box_pack_start (GTK_BOX (search_bar), priv->hbox, TRUE, FALSE, 0);
- entry = nld_search_entry_new ();
+ entry = gtk_search_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_START);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
- priv->entry = GTK_ENTRY (entry);
+ priv->entry = GTK_SEARCH_ENTRY (entry);
gtk_widget_show (entry);
gtk_box_pack_start (GTK_BOX (priv->hbox), entry, TRUE, TRUE, 0);
@@ -151,7 +150,7 @@ nld_search_bar_clear (NldSearchBar * search_bar)
NldSearchBarPrivate *priv = NLD_SEARCH_BAR_GET_PRIVATE (search_bar);
priv->block_signal = TRUE;
- gtk_entry_set_text (priv->entry, "");
+ gtk_entry_set_text (GTK_ENTRY (priv->entry), "");
if (priv->context_picker)
nld_search_context_picker_set_context (priv->context_picker, 0);
priv->block_signal = FALSE;
@@ -325,7 +324,7 @@ nld_search_bar_get_text (NldSearchBar * search_bar)
{
NldSearchBarPrivate *priv = NLD_SEARCH_BAR_GET_PRIVATE (search_bar);
- return gtk_entry_get_text (priv->entry);
+ return gtk_entry_get_text (GTK_ENTRY (priv->entry));
}
void
@@ -333,7 +332,7 @@ nld_search_bar_set_text (NldSearchBar * search_bar, const char *text, gboolean a
{
NldSearchBarPrivate *priv = NLD_SEARCH_BAR_GET_PRIVATE (search_bar);
- gtk_entry_set_text (priv->entry, text);
+ gtk_entry_set_text (GTK_ENTRY (priv->entry), text);
if (activate)
emit_search (search_bar);
}